DevOps Classroom Series – 09/Nov/2020

Docker Networking

  • For single host networking Refer Here
  • For docker swarm Refer Here
  • For overlay & multihost networking Refer Here
  • Docker networking follows a specification called as Container Network Model (CNM) Refer Here
  • Docker has a opensource project called as libnetwork which is implementation of CNM Preview
  • Lets experiment with default bridge network
  • Create two containers dc1 and dc2
docker container run --name dc1 -d alpine sleep 1d
docker container run --name dc2 -d alpine sleep 1d

Preview

  • Now lets login into dc1 and ping dc2 Preview
  • Now lets find ip addresses of dc1 and dc2 . try pinging with ip address Preview Preview
  • As per the observations we can ping from one container to other container using ip address in default bridge network
  • Now lets create user defined bridge network Preview
  • Now lets inspect the created network docker network inspect <network-name> Preview
  • Lets create two containers as shown above in user-defined network Preview
  • Now lets try to ping from one cotnainer to other Preview
  • User defined bridge networks have name based resolution enabled.
  • Running applications on single host might lead to single point of failure, we need to run our containers on multiple machines and there should be connectivity.
  • This is where we will be learning Docker multi-host networking (Overlay driver) and We will introduce Docker Swarm.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About learningthoughtsadmin