DEV Community

Shahriyar Al Mustakim Mitul
Shahriyar Al Mustakim Mitul

Posted on

Docker series (Part 6): Docker Networking Basics

Actually, containers need to use bridge which generally has a different IP address . These containers go through these bridge and then passes the firewall to the port.

when we create a container, we publish the container using -p

Image description

Image description
SO, if you check your devices IP address & this containers IP address, you will see that they are not same. Because the container is passing through a bridge which has its own IP address.

Image description
SO, this is the IP address of the bridge . The bridge is a medium through your devices firewall.

For this container, this is how it might look

Image description
Any traffic coming from port 80 passes through this IP and then go to the container.

Also, if you set another container with the same bridge, the containers then can contact each other.

Image description

So, that was it!

Top comments (0)