Is there a way to specify hostname when starting c

2019-04-17 11:01发布

问题:

I have been trying to setup a docker image on Azure and am running into an issue. The image has been designed to require a -h hostname argument when starting it using the docker commands.

The image is here: https://hub.docker.com/r/sverhoeven/cartodb/

I can't translate these commands into something I can do on Azure.

The options for -h are as follows:

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

Here is what happens by not telling the image what hostname to use - Note, when you don't specify the hostname, it defaults to localhost. I am seeing a lot of 127.0.0.1 in the log output and some references to localhost. That is concerning.:

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

I am looking for suggestions or solutions.

Note: This is tangentially related to another question I asked concerning the carto image here.

回答1:

After going around and around, the short answer is no, this is not possible right now. Workaround is to use an environment variable