September 30, 2025Sep 30 I have docker containers on the bridged network. Each container gets an IP address from 172.17.0.2 and up, according to the way the containers are ordered.I would like containers to resolve a container name to the assigned IP address. Is this possible? It should be unaffected when I reorder the boot order of containers. This way I don't need to exposes container services (port mapping) which are only used by other containers.
October 1, 2025Oct 1 Author Okay, this is actually pretty simple to achieve. First create a user-defined network in Docker:# docker network create my_networkThen configure the Network Type for all containers which need direct access to each other to Custom: my_network. Remove port mappings which are only needed for internal traffic. Container names will resolve to the (internal) IP address.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.