Get a Docker Containers IP Address from the Host Containers added to non-default networks will be able to access each other through their alias My exampleĬreate new network is devopsroles, run containers, and access the other containers using an alias as below: docker network create devopsrolesĭocker run -net devopsroles -name nginx -d nginxĭocker network connect devopsroles -alias mongohost mongodb Containers launched by default in the “bridge network” and allowed to communicate with another container directly.
How do you need to know each container’s IP address? Docker networking is a little complicated.