Running Docker on my Synology NAS. My apps are all on the Bridge network. I can connect to an app from another app using their Docker IP address, but not the Docker container name. They are all using the default Bridge network. The obvious issue is if the containers are restarted and get a different IP address things will stop working, hence I would like to use the Container name.
I am relatively new to Docker and don’t understand how the DNS would work or how to troubleshoot this issue. Any suggestions? Thanks.
No, it won’t work on the dfault bridge network. At least not without recreating the containers and use the legacy links if that still works, but with custom networks, you don’t need to restart the container. You can just connect the networks to the containers
https://docs.docker.com/engine/reference/commandline/network_connect/
Oh, and I should also mention that recreating the containers should not be a problem if you create them properly.
You need the containers to use a common network in order to be able to communicate. But if you read the documentation I shared, you will find the answer
You can connect a container by name or by ID. Once connected, the container can communicate with other containers
in the same network.