Dear all,
I’m really new with Docker, but I’ve been tasked with looking after a running container and I’ve hit a brick wall.
At first, it and the host machine (Ubuntu 18.04) was running fine. Let’s say its hostname was www.example.com and it had an IP address of 123.123.123.123 .
And then, my organisation required us to change to a private IP address. Let’s say 192.168.123.123 .
On the host machine, I released and got the new private IP address fine via DHCP. I can ssh in and, if I installed Apache on it, then I can go to www.example.com with no problems.
In our case, several Docker containers are running. One is running Nginx and another is our app in question (written using Ruby on Rails). Previously, http/https traffic would be filtered using Nginx and sent off to the app.
Now, I’m completely unable to access this app. When I go to the site, I’m getting an Nginx problem about an upstream connection. There is no problem with other Docker containers on the computer… When I tail the logs for the app, it is still trying to access 123.123.123.123. But, on the host machine, I can ping , etc. and I would get the new local IP address.
Perhaps there are other issues that I am facing. But, I think I shouldn’t see 123.123.123.123 within the running Docker containers’ log files any more. I thought it would “figure it out” after some time has passed, but half a day has passed and it still doesn’t use the new IP address.
So far, I’ve tried:
- Flushing the host computers’ DNS (sudo systemd-resolve --flush-caches for Ubuntu 18.04)
- Manually adding the new local address to the host computer’s /etc/hosts file
- Stopping and restarting the Docker container
Personally, I don’t know Ruby on Rails. So, I don’t have the knowledge to go into the code and fix it
Any suggestions would be appreciated! There might be other issues at play that are preventing me from accessing the application, but so far, the fact that the application is still trying to access the old IP address seems to be the most noticeable problem.
Thank you in advance!
Ray