Docker Networking

 So you have deployed your first docker container and tested the hello world app, what now? Docker is incredibly powerful and you the more you explore the more useful tools you will discover. One of the most important apsects of Docker is the networking stack which enables your services to be discovered by other network nodes. Docker supports multiple network drivers as mentioned on their support page. Initially some rudementary knowledge of networks will work but eventually you have to have good networking concepts to make the best use of docker.

The first command:

docker network ls

 

The names bridge, host & none are created by default. You can create new networks as well like I have created.

Simplified version of these drivers is this:

host: Use the hosts networking, the process inside the container are still isolated from rest of the system except for networking

so we have started a container with networking set to host without any kind of Port forwarding or NATing. let see if this works. Tomcat default port is 8080, if I access this port on my the host system i should get a tomcat page.


Success!

none: container starts without any networking


bridge: containers connected to same bridge can communicate with each other.



Comments

Popular Posts