I have a web application with an interface hosted in Docker. The backend already exists, but it has a "user IP address", so I had to update the local / etc / hosts file to access it. This way, from my local machine, I can access the API without any problems.
But the problem is that Docker somehow cannot resolve this "custom IP" even if the host is written in the container file (image?) / Etc / hosts.
When the Docker container starts, I see this error
$ docker run media-saturn:dev 2016/05/11 07:26:46 [emerg] 1#1: host not found in upstream "my-server-address.com" in /etc/nginx/sites/ms.dev.my-company.com:36 nginx: [emerg] host not found in upstream "my-server-address.com" in /etc/nginx/sites/ms.dev.my-company.com:36
I am updating the / etc / hosts file using the command in the Dockerfile, for example
# install wget RUN apt-get update \ && apt-get install -y wget \ && rm -rf /var/lib/apt/lists/*
When I SSH into the machine to check the current contents of / etc / hosts, the line "123.45.123.45 my-server-address.com" really exists.
Can anyone help me with this? I'm a new docker.
source share