gpt4 book ai didi

azure - 在azure云实例上启动容器时有没有办法指定主机名

转载 作者:行者123 更新时间:2023-12-02 18:29:45 25 4
gpt4 key购买 nike

我一直在尝试在 Azure 上设置 docker 镜像,但遇到了问题。该镜像被设计为在使用 docker 命令启动时需要 -h 主机名参数。

图片在这里:https://hub.docker.com/r/sverhoeven/cartodb/

我无法将这些命令转换为我可以在 Azure 上执行的操作。

-h 的选项如下:

How to use a different hostname:

For example to use cartodb.example.com as a hostname start with:

docker run -d -p 80:80 -h cartodb.example.com sverhoeven/cartodb 

The chosen hostname should also resolve to an IP adress of the machine where the web server is running. If you don't have a domain/subdomain pointing to your server yet, you can use the servers external ip address:

docker run -d -p 80:80 -h <servers-external-ip-address> sverhoeven/cartodb

以下是不告诉图像使用什么主机名会发生的情况 - 请注意,当您不指定主机名时,它默认为 localhost。我在日志输出中看到很多 127.0.0.1 以及一些对 localhost 的引用。这是令人担忧的。:

Started GET "/" for 127.0.0.1 at 2018-06-20 01:53:59 +0000
Processing by Admin::PagesController#index as */*
...
Redirected to http://localhost/login
...
Started GET "/favicon.ico" for 127.0.0.1 at 2018-06-20 01:54:25 +0000
ActionController::RoutingError (No route matches [GET] "/favicon.ico"):
...
Started POST "/sessions/create" for 127.0.0.1 at 2018-06-20 01:54:39 +0000
Started GET "/user/dev/dashboard/" for 127.0.0.1 at 2018-06-20 01:54:39 +0000

我正在寻找建议或解决方案。

注意:这与我提出的有关 carto 图像 here 的另一个问题无关。 .

最佳答案

经过一番思考后,简短的答案是否定的,目前这是不可能的。解决方法是使用环境变量

关于azure - 在azure云实例上启动容器时有没有办法指定主机名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50959411/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com