However, IP addresses are ephemeral, and can break easily when containers are stopped and started. This is the primary use case of accessing a container directly through its IP address, but you should probably still just bind a port (you can keep it closed from the internet in your firewall). You can also use this address to communicate from the host OS if you don’t want to bind a port.
This can be turned off for true isolation, but it isn’t by default. Containers launched by default will be placed in the default “bridge network,” and are allowed to communicate with other containers directly, provided you have their private IP address.
Consider Using a User-Defined Bridgeĭocker networking is a little complicated. But, to communicate, you’ll often need to know each container’s IP address, which you can find with a few commands. Docker containers aren’t just about isolation-they’re often used to manage processes that still need to talk to each other directly.