Today I had a case where I was trying to access a container running Jenkins-CI server from the Docker Host.
X11 is installed on the Docker Host, and to access the Jenkins container I had to enter the IP address http://172.17.0.2:8080/.
I asked Firefox to save the login details to the Jenkins instance running in that container.
This works fine until the IP address of the container gets changed, like when I stopped and started the Jenkins container.
On restart the IP address had changed to something else, like 172.17.0.5:8080/
So Firefox thought this was a different website, and did not populate the password field for me to login to Jenkins-CI as admin.
Looking at the saved passwords in Firefox, I can see the password saved under the first IP address for the running container.
Saving the password again just repeats the password for the next IP address the container has been given.
Is there any way for the Docker Host to save the IP addresses and domain names for all the containers that are running on that host in it’s own /etc/hosts file please, so we can get access to those containers running on that host by domain name, and will not be affected by the IP addresses changing when containers running on that host get their IP addresses changed please?
Possibly in a similar way that the container /etc/hosts files are updated after a container they link to has been stopped and started, and the IP address has changed?
Hope that makes good sense.
TIA
Keith