SlideShare a Scribd company logo
Docker Networking
ADITYA GAWADE
Docker Basics
MANAGING IMAGES AND CONTAINERS
What's Docker?
 Containerization platform
 Provides leaner / application specific virtual machines.
 Uses existing kernel features such as namespaces and cgroups
 Open source and available on Linux distributions.
 Applications are installed on containers packaged, shipped and deployed
 This eliminates low level dependencies.
How Docker Works?
Host
Client
Registry
Docker-client
Docker run
Docker ps
C1
C2
C3
Docker daemon
N
E
T
W
O
R
K
Docker basic commands
 Docker run – Run a container
 Docker attach – attach to a running container
 Docker info – identify docker version and configuration details
 Docker ps – Show currently running containers.
 Docker images - list images cached locally.
 Docker <command> --help – show command options
Docker Single Host
Networking
NETWORK ON A SINGLE DOCKER HOST
Docker Bridge
 Docker provides a default bridge "docker0"
 By default, all containers are connected to "docker0"
 Bridge connects all containers on a single host
 Docker network ls – to view existing networks
User defined Networks (Bridge)
 Docker network create – to create a new network/driver
 Docker run –itd –name=container1 –network=<custom bridge name> <image>
 Eg:
docker network create –driver bridge isolated_nw
Option to
create a
network
Create
custom driver
Custom network
name
Multi-host Networking
(Overlay)
DEPLOYING A NETWORK ACROSS HOSTS
Different Methods of Multihost
Networking
 Overlay Network
 Macvlan
 Open virtual switch (OVS)
 Standard bridge utilites (brctl)
Overlay Concept
KV STORE
Consul
Docker Host 1 Docker Host 2
C1 C2Serf + VXLAN
Overlay Network
Serf
 Created by Hashicorp
 Used for orchestration and cluster management
 Uses Gossip Protocol
 Infrequent UDP messages
 Supported on Linux, Mac OS and Windows
VXLAN (Virtual Extensible LAN)
 Extend VLAN address space.
 Used for Overlays to implement Encapsulation over Layer 3 infrastructure
 Encapsulates Layer 2 information (VXLAN No.) in Layer 3 Packet.
Image sourced from "Arista VXLAN Bridging with DCI Head End Replication"
http://www.intelligentvisibility.com/blog/?p=376
Steps to create an overlay network
1. Check and update Docker Engine (Latest version 1.12) on hosts.
2. Set up a KV Store
3. Connect hosts to KV store
4. Create an overlay network.
5. Add containers to overlay network
6. Check connectivity between containers
Setting up a KV store
 We are using a Consul container as a Docker host
 It s deployed on an external host.
 docker run -d -p 8500:8500 -h consul --name consul progrium/consul -server -bootstrap
-p = publish a container's port to host
-d = detach/ run in background
-h = container hostname
 Docker port consul – check port binding
Connecting hosts to KV Store
 Stop the docker service
$ sudo systemctl stop docker.service (RedHat)
$ sudo service docker stop
 Connect hosts to KV store
sudo docker daemon -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock --
cluster-advertise <Net int of host>:2375 --cluster-store consul://<Public IP of host
interface>:8500
-H = host --cluster-advertise = send advertisements for cluster on intf:2375 --
cluster-store = IP of KV store/cluster manager
Hosts Joining a Cluster
Create an overlay Network
 On any host:
docker network create –d overlay --subnet=<IP address>/<Mask> <network
name>
Add containers to overlay network
 On each of the hosts:
docker run –itd --name=<container name> --network=<overlay name>
<container image>
Docker network inspect <overlay name> (for Verification)
Overlay Network Image
Checking connectivity between containers
 Ping From C1 to C2
docker exec C2 ping –w5 C1
References
 Introduction to Docker:
https://sysadmincasts.com/episodes/31-introduction-to-docker
 Docker Container Networking:
https://docs.docker.com/engine/userguide/networking/
 Docker Multi-host Network:
https://luppeng.wordpress.com/2016/05/03/setting-up-an-overlay-network-on-docker-without-swarm/
 Docker Networking Deep Dive (DockerCon 15):
https://www.youtube.com/watch?v=vb7U_9AO7Ww
 4 Ways to Connect Containers to Local Network
http://blog.oddbit.com/2014/08/11/four-ways-to-connect-a-docker/
 VXLAN Definition:
http://whatis.techtarget.com/definition/VXLAN
 Serf
https://www.serf.io/
 Install Docker on Ubuntu
https://docs.docker.com/engine/installation/linux/ubuntulinux/
 Install Docker on Centos
https://docs.docker.com/engine/installation/linux/centos/
Ad

More Related Content

What's hot (20)

Docker Networking - Common Issues and Troubleshooting Techniques
Docker Networking - Common Issues and Troubleshooting TechniquesDocker Networking - Common Issues and Troubleshooting Techniques
Docker Networking - Common Issues and Troubleshooting Techniques
Sreenivas Makam
 
Academy PRO: Docker. Part 1
Academy PRO: Docker. Part 1Academy PRO: Docker. Part 1
Academy PRO: Docker. Part 1
Binary Studio
 
Docker Networking - Current Status and goals of Experimental Networking
Docker Networking - Current Status and goals of Experimental NetworkingDocker Networking - Current Status and goals of Experimental Networking
Docker Networking - Current Status and goals of Experimental Networking
Sreenivas Makam
 
Docker meetup
Docker meetupDocker meetup
Docker meetup
syed1
 
Intro- Docker Native for OSX and Windows
Intro- Docker Native for OSX and WindowsIntro- Docker Native for OSX and Windows
Intro- Docker Native for OSX and Windows
Thomas Chacko
 
Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2
Binary Studio
 
Hands on introduction to docker security for docker newbies
Hands on introduction to docker security for docker newbiesHands on introduction to docker security for docker newbies
Hands on introduction to docker security for docker newbies
Yigal Elefant
 
Docker 1.11 @ Docker SF Meetup
Docker 1.11 @ Docker SF MeetupDocker 1.11 @ Docker SF Meetup
Docker 1.11 @ Docker SF Meetup
Docker, Inc.
 
Introduction to docker swarm
Introduction to docker swarmIntroduction to docker swarm
Introduction to docker swarm
Walid Ashraf
 
Academy PRO: Docker. Part 4
Academy PRO: Docker. Part 4Academy PRO: Docker. Part 4
Academy PRO: Docker. Part 4
Binary Studio
 
Deep Dive into Docker Swarm Mode
Deep Dive into Docker Swarm ModeDeep Dive into Docker Swarm Mode
Deep Dive into Docker Swarm Mode
Ajeet Singh Raina
 
Introduction to docker security
Introduction to docker securityIntroduction to docker security
Introduction to docker security
Walid Ashraf
 
Docker Online Meetup #28: Production-Ready Docker Swarm
Docker Online Meetup #28: Production-Ready Docker SwarmDocker Online Meetup #28: Production-Ready Docker Swarm
Docker Online Meetup #28: Production-Ready Docker Swarm
Docker, Inc.
 
Docker 1.12 networking deep dive
Docker 1.12 networking deep diveDocker 1.12 networking deep dive
Docker 1.12 networking deep dive
Madhu Venugopal
 
Docker Machine & Docker Swarm
Docker Machine & Docker SwarmDocker Machine & Docker Swarm
Docker Machine & Docker Swarm
Guillermo Lucero
 
Docker Online Meetup #29: Docker Networking is Now GA
Docker Online Meetup #29: Docker Networking is Now GA Docker Online Meetup #29: Docker Networking is Now GA
Docker Online Meetup #29: Docker Networking is Now GA
Docker, Inc.
 
dockerizing web application
dockerizing web applicationdockerizing web application
dockerizing web application
Walid Ashraf
 
Docker advance1
Docker advance1Docker advance1
Docker advance1
Gourav Varma
 
Docker Swarm 0.2.0
Docker Swarm 0.2.0Docker Swarm 0.2.0
Docker Swarm 0.2.0
Docker, Inc.
 
Docker network Present in VietNam DockerDay 2015
Docker network Present in VietNam DockerDay 2015Docker network Present in VietNam DockerDay 2015
Docker network Present in VietNam DockerDay 2015
Van Phuc
 
Docker Networking - Common Issues and Troubleshooting Techniques
Docker Networking - Common Issues and Troubleshooting TechniquesDocker Networking - Common Issues and Troubleshooting Techniques
Docker Networking - Common Issues and Troubleshooting Techniques
Sreenivas Makam
 
Academy PRO: Docker. Part 1
Academy PRO: Docker. Part 1Academy PRO: Docker. Part 1
Academy PRO: Docker. Part 1
Binary Studio
 
Docker Networking - Current Status and goals of Experimental Networking
Docker Networking - Current Status and goals of Experimental NetworkingDocker Networking - Current Status and goals of Experimental Networking
Docker Networking - Current Status and goals of Experimental Networking
Sreenivas Makam
 
Docker meetup
Docker meetupDocker meetup
Docker meetup
syed1
 
Intro- Docker Native for OSX and Windows
Intro- Docker Native for OSX and WindowsIntro- Docker Native for OSX and Windows
Intro- Docker Native for OSX and Windows
Thomas Chacko
 
Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2
Binary Studio
 
Hands on introduction to docker security for docker newbies
Hands on introduction to docker security for docker newbiesHands on introduction to docker security for docker newbies
Hands on introduction to docker security for docker newbies
Yigal Elefant
 
Docker 1.11 @ Docker SF Meetup
Docker 1.11 @ Docker SF MeetupDocker 1.11 @ Docker SF Meetup
Docker 1.11 @ Docker SF Meetup
Docker, Inc.
 
Introduction to docker swarm
Introduction to docker swarmIntroduction to docker swarm
Introduction to docker swarm
Walid Ashraf
 
Academy PRO: Docker. Part 4
Academy PRO: Docker. Part 4Academy PRO: Docker. Part 4
Academy PRO: Docker. Part 4
Binary Studio
 
Deep Dive into Docker Swarm Mode
Deep Dive into Docker Swarm ModeDeep Dive into Docker Swarm Mode
Deep Dive into Docker Swarm Mode
Ajeet Singh Raina
 
Introduction to docker security
Introduction to docker securityIntroduction to docker security
Introduction to docker security
Walid Ashraf
 
Docker Online Meetup #28: Production-Ready Docker Swarm
Docker Online Meetup #28: Production-Ready Docker SwarmDocker Online Meetup #28: Production-Ready Docker Swarm
Docker Online Meetup #28: Production-Ready Docker Swarm
Docker, Inc.
 
Docker 1.12 networking deep dive
Docker 1.12 networking deep diveDocker 1.12 networking deep dive
Docker 1.12 networking deep dive
Madhu Venugopal
 
Docker Machine & Docker Swarm
Docker Machine & Docker SwarmDocker Machine & Docker Swarm
Docker Machine & Docker Swarm
Guillermo Lucero
 
Docker Online Meetup #29: Docker Networking is Now GA
Docker Online Meetup #29: Docker Networking is Now GA Docker Online Meetup #29: Docker Networking is Now GA
Docker Online Meetup #29: Docker Networking is Now GA
Docker, Inc.
 
dockerizing web application
dockerizing web applicationdockerizing web application
dockerizing web application
Walid Ashraf
 
Docker Swarm 0.2.0
Docker Swarm 0.2.0Docker Swarm 0.2.0
Docker Swarm 0.2.0
Docker, Inc.
 
Docker network Present in VietNam DockerDay 2015
Docker network Present in VietNam DockerDay 2015Docker network Present in VietNam DockerDay 2015
Docker network Present in VietNam DockerDay 2015
Van Phuc
 

Viewers also liked (15)

BLUG Presentation - sysdig - Feb 2017
BLUG Presentation - sysdig - Feb 2017BLUG Presentation - sysdig - Feb 2017
BLUG Presentation - sysdig - Feb 2017
Dan Mackin
 
Joomla Day Poland 15 - Docker
Joomla Day Poland 15 - DockerJoomla Day Poland 15 - Docker
Joomla Day Poland 15 - Docker
Lukas Lesniewski
 
Atlassian User Group Lower Silesia BUILDFAILUJE? PRZECIEŻ U MNIE DZIAŁAŁO
Atlassian User Group Lower Silesia BUILDFAILUJE? PRZECIEŻ U MNIE DZIAŁAŁOAtlassian User Group Lower Silesia BUILDFAILUJE? PRZECIEŻ U MNIE DZIAŁAŁO
Atlassian User Group Lower Silesia BUILDFAILUJE? PRZECIEŻ U MNIE DZIAŁAŁO
NetworkedAssets
 
Networking in Docker Containers
Networking in Docker ContainersNetworking in Docker Containers
Networking in Docker Containers
Attila Kanto
 
Lessons learned in reaching multi-host container networking
Lessons learned in reaching multi-host container networkingLessons learned in reaching multi-host container networking
Lessons learned in reaching multi-host container networking
Tony Georgiev
 
Multi host networking with docker
Multi host networking with dockerMulti host networking with docker
Multi host networking with docker
MyoungSu Shin
 
Docker Networking – Running multi-host applications
Docker Networking – Running multi-host applicationsDocker Networking – Running multi-host applications
Docker Networking – Running multi-host applications
Christina Rasimus
 
Docker Multi Host Networking, Rachit Arora, IBM
Docker Multi Host Networking, Rachit Arora, IBMDocker Multi Host Networking, Rachit Arora, IBM
Docker Multi Host Networking, Rachit Arora, IBM
Neependra Khare
 
Single Host Docker Networking
Single Host Docker NetworkingSingle Host Docker Networking
Single Host Docker Networking
allingeek
 
#eventcepcja Networking Izabela Górska (Business Link Warszawa)
#eventcepcja Networking Izabela Górska (Business Link Warszawa)#eventcepcja Networking Izabela Górska (Business Link Warszawa)
#eventcepcja Networking Izabela Górska (Business Link Warszawa)
Edyta Kowal
 
Docker Networking
Docker NetworkingDocker Networking
Docker Networking
Kingston Smiler
 
Docker-OVS
Docker-OVSDocker-OVS
Docker-OVS
snrism
 
Docker networking Tutorial 101
Docker networking Tutorial 101Docker networking Tutorial 101
Docker networking Tutorial 101
LorisPack Project
 
Docker Networking Deep Dive
Docker Networking Deep DiveDocker Networking Deep Dive
Docker Networking Deep Dive
Docker, Inc.
 
Docker networking basics & coupling with Software Defined Networks
Docker networking basics & coupling with Software Defined NetworksDocker networking basics & coupling with Software Defined Networks
Docker networking basics & coupling with Software Defined Networks
Adrien Blind
 
BLUG Presentation - sysdig - Feb 2017
BLUG Presentation - sysdig - Feb 2017BLUG Presentation - sysdig - Feb 2017
BLUG Presentation - sysdig - Feb 2017
Dan Mackin
 
Joomla Day Poland 15 - Docker
Joomla Day Poland 15 - DockerJoomla Day Poland 15 - Docker
Joomla Day Poland 15 - Docker
Lukas Lesniewski
 
Atlassian User Group Lower Silesia BUILDFAILUJE? PRZECIEŻ U MNIE DZIAŁAŁO
Atlassian User Group Lower Silesia BUILDFAILUJE? PRZECIEŻ U MNIE DZIAŁAŁOAtlassian User Group Lower Silesia BUILDFAILUJE? PRZECIEŻ U MNIE DZIAŁAŁO
Atlassian User Group Lower Silesia BUILDFAILUJE? PRZECIEŻ U MNIE DZIAŁAŁO
NetworkedAssets
 
Networking in Docker Containers
Networking in Docker ContainersNetworking in Docker Containers
Networking in Docker Containers
Attila Kanto
 
Lessons learned in reaching multi-host container networking
Lessons learned in reaching multi-host container networkingLessons learned in reaching multi-host container networking
Lessons learned in reaching multi-host container networking
Tony Georgiev
 
Multi host networking with docker
Multi host networking with dockerMulti host networking with docker
Multi host networking with docker
MyoungSu Shin
 
Docker Networking – Running multi-host applications
Docker Networking – Running multi-host applicationsDocker Networking – Running multi-host applications
Docker Networking – Running multi-host applications
Christina Rasimus
 
Docker Multi Host Networking, Rachit Arora, IBM
Docker Multi Host Networking, Rachit Arora, IBMDocker Multi Host Networking, Rachit Arora, IBM
Docker Multi Host Networking, Rachit Arora, IBM
Neependra Khare
 
Single Host Docker Networking
Single Host Docker NetworkingSingle Host Docker Networking
Single Host Docker Networking
allingeek
 
#eventcepcja Networking Izabela Górska (Business Link Warszawa)
#eventcepcja Networking Izabela Górska (Business Link Warszawa)#eventcepcja Networking Izabela Górska (Business Link Warszawa)
#eventcepcja Networking Izabela Górska (Business Link Warszawa)
Edyta Kowal
 
Docker-OVS
Docker-OVSDocker-OVS
Docker-OVS
snrism
 
Docker networking Tutorial 101
Docker networking Tutorial 101Docker networking Tutorial 101
Docker networking Tutorial 101
LorisPack Project
 
Docker Networking Deep Dive
Docker Networking Deep DiveDocker Networking Deep Dive
Docker Networking Deep Dive
Docker, Inc.
 
Docker networking basics & coupling with Software Defined Networks
Docker networking basics & coupling with Software Defined NetworksDocker networking basics & coupling with Software Defined Networks
Docker networking basics & coupling with Software Defined Networks
Adrien Blind
 
Ad

Similar to Docker Networking - Boulder Linux Users Group (BLUG) (20)

Docker Introduction and its Usage in Machine Learning
Docker Introduction and its Usage in Machine LearningDocker Introduction and its Usage in Machine Learning
Docker Introduction and its Usage in Machine Learning
yogendra18
 
How Reconnix Is Using Docker
How Reconnix Is Using DockerHow Reconnix Is Using Docker
How Reconnix Is Using Docker
Russ Mckendrick
 
JDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
JDO 2019: Tips and Tricks from Docker Captain - Łukasz LachJDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
JDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
PROIDEA
 
Running .NET on Docker
Running .NET on DockerRunning .NET on Docker
Running .NET on Docker
Ben Hall
 
Buildservicewithdockerin90mins
Buildservicewithdockerin90minsBuildservicewithdockerin90mins
Buildservicewithdockerin90mins
Yong Cha
 
Docker: A New Way to Turbocharging Your Apps Development
Docker: A New Way to Turbocharging Your Apps DevelopmentDocker: A New Way to Turbocharging Your Apps Development
Docker: A New Way to Turbocharging Your Apps Development
msyukor
 
Docker, Kubernetes, and Google Cloud
Docker, Kubernetes, and Google CloudDocker, Kubernetes, and Google Cloud
Docker, Kubernetes, and Google Cloud
Samuel Chow
 
Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)
Ben Hall
 
Architecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based DeploymentsArchitecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based Deployments
Ben Hall
 
Docker From Scratch
Docker From ScratchDocker From Scratch
Docker From Scratch
Giacomo Vacca
 
Containerizing Web Application with Docker
Containerizing Web Application with DockerContainerizing Web Application with Docker
Containerizing Web Application with Docker
msyukor
 
Docker container a-brief_introduction_2016-01-30
Docker container a-brief_introduction_2016-01-30Docker container a-brief_introduction_2016-01-30
Docker container a-brief_introduction_2016-01-30
Khelender Sasan
 
Docker Networking Overview
Docker Networking OverviewDocker Networking Overview
Docker Networking Overview
Sreenivas Makam
 
Orchestrating Docker with OpenStack
Orchestrating Docker with OpenStackOrchestrating Docker with OpenStack
Orchestrating Docker with OpenStack
Erica Windisch
 
Docker 進階實務班
Docker 進階實務班Docker 進階實務班
Docker 進階實務班
Philip Zheng
 
廣宣學堂: 容器進階實務 - Docker進深研究班
廣宣學堂: 容器進階實務 - Docker進深研究班廣宣學堂: 容器進階實務 - Docker進深研究班
廣宣學堂: 容器進階實務 - Docker進深研究班
Paul Chao
 
Deploying .net core apps to Docker - dotnetConf Local Bengaluru
Deploying .net core apps to Docker - dotnetConf Local BengaluruDeploying .net core apps to Docker - dotnetConf Local Bengaluru
Deploying .net core apps to Docker - dotnetConf Local Bengaluru
Swaminathan Vetri
 
Apache jclouds and Docker
Apache jclouds and DockerApache jclouds and Docker
Apache jclouds and Docker
Andrea Turli
 
Docker workshop 0507 Taichung
Docker workshop 0507 Taichung Docker workshop 0507 Taichung
Docker workshop 0507 Taichung
Paul Chao
 
手把手帶你學 Docker 入門篇
手把手帶你學 Docker 入門篇手把手帶你學 Docker 入門篇
手把手帶你學 Docker 入門篇
Philip Zheng
 
Docker Introduction and its Usage in Machine Learning
Docker Introduction and its Usage in Machine LearningDocker Introduction and its Usage in Machine Learning
Docker Introduction and its Usage in Machine Learning
yogendra18
 
How Reconnix Is Using Docker
How Reconnix Is Using DockerHow Reconnix Is Using Docker
How Reconnix Is Using Docker
Russ Mckendrick
 
JDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
JDO 2019: Tips and Tricks from Docker Captain - Łukasz LachJDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
JDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
PROIDEA
 
Running .NET on Docker
Running .NET on DockerRunning .NET on Docker
Running .NET on Docker
Ben Hall
 
Buildservicewithdockerin90mins
Buildservicewithdockerin90minsBuildservicewithdockerin90mins
Buildservicewithdockerin90mins
Yong Cha
 
Docker: A New Way to Turbocharging Your Apps Development
Docker: A New Way to Turbocharging Your Apps DevelopmentDocker: A New Way to Turbocharging Your Apps Development
Docker: A New Way to Turbocharging Your Apps Development
msyukor
 
Docker, Kubernetes, and Google Cloud
Docker, Kubernetes, and Google CloudDocker, Kubernetes, and Google Cloud
Docker, Kubernetes, and Google Cloud
Samuel Chow
 
Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)
Ben Hall
 
Architecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based DeploymentsArchitecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based Deployments
Ben Hall
 
Containerizing Web Application with Docker
Containerizing Web Application with DockerContainerizing Web Application with Docker
Containerizing Web Application with Docker
msyukor
 
Docker container a-brief_introduction_2016-01-30
Docker container a-brief_introduction_2016-01-30Docker container a-brief_introduction_2016-01-30
Docker container a-brief_introduction_2016-01-30
Khelender Sasan
 
Docker Networking Overview
Docker Networking OverviewDocker Networking Overview
Docker Networking Overview
Sreenivas Makam
 
Orchestrating Docker with OpenStack
Orchestrating Docker with OpenStackOrchestrating Docker with OpenStack
Orchestrating Docker with OpenStack
Erica Windisch
 
Docker 進階實務班
Docker 進階實務班Docker 進階實務班
Docker 進階實務班
Philip Zheng
 
廣宣學堂: 容器進階實務 - Docker進深研究班
廣宣學堂: 容器進階實務 - Docker進深研究班廣宣學堂: 容器進階實務 - Docker進深研究班
廣宣學堂: 容器進階實務 - Docker進深研究班
Paul Chao
 
Deploying .net core apps to Docker - dotnetConf Local Bengaluru
Deploying .net core apps to Docker - dotnetConf Local BengaluruDeploying .net core apps to Docker - dotnetConf Local Bengaluru
Deploying .net core apps to Docker - dotnetConf Local Bengaluru
Swaminathan Vetri
 
Apache jclouds and Docker
Apache jclouds and DockerApache jclouds and Docker
Apache jclouds and Docker
Andrea Turli
 
Docker workshop 0507 Taichung
Docker workshop 0507 Taichung Docker workshop 0507 Taichung
Docker workshop 0507 Taichung
Paul Chao
 
手把手帶你學 Docker 入門篇
手把手帶你學 Docker 入門篇手把手帶你學 Docker 入門篇
手把手帶你學 Docker 入門篇
Philip Zheng
 
Ad

Recently uploaded (20)

211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
inmishra17121973
 
Introduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptxIntroduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptx
AS1920
 
Degree_of_Automation.pdf for Instrumentation and industrial specialist
Degree_of_Automation.pdf for  Instrumentation  and industrial specialistDegree_of_Automation.pdf for  Instrumentation  and industrial specialist
Degree_of_Automation.pdf for Instrumentation and industrial specialist
shreyabhosale19
 
IntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdfIntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdf
Luiz Carneiro
 
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E..."Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
Infopitaara
 
Value Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous SecurityValue Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous Security
Marc Hornbeek
 
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITYADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ijscai
 
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdffive-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
AdityaSharma944496
 
Process Parameter Optimization for Minimizing Springback in Cold Drawing Proc...
Process Parameter Optimization for Minimizing Springback in Cold Drawing Proc...Process Parameter Optimization for Minimizing Springback in Cold Drawing Proc...
Process Parameter Optimization for Minimizing Springback in Cold Drawing Proc...
Journal of Soft Computing in Civil Engineering
 
Artificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptxArtificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptx
aditichinar
 
introduction to machine learining for beginers
introduction to machine learining for beginersintroduction to machine learining for beginers
introduction to machine learining for beginers
JoydebSheet
 
15th International Conference on Computer Science, Engineering and Applicatio...
15th International Conference on Computer Science, Engineering and Applicatio...15th International Conference on Computer Science, Engineering and Applicatio...
15th International Conference on Computer Science, Engineering and Applicatio...
IJCSES Journal
 
Data Structures_Introduction to algorithms.pptx
Data Structures_Introduction to algorithms.pptxData Structures_Introduction to algorithms.pptx
Data Structures_Introduction to algorithms.pptx
RushaliDeshmukh2
 
Smart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineeringSmart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineering
rushikeshnavghare94
 
Structural Response of Reinforced Self-Compacting Concrete Deep Beam Using Fi...
Structural Response of Reinforced Self-Compacting Concrete Deep Beam Using Fi...Structural Response of Reinforced Self-Compacting Concrete Deep Beam Using Fi...
Structural Response of Reinforced Self-Compacting Concrete Deep Beam Using Fi...
Journal of Soft Computing in Civil Engineering
 
Metal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistryMetal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistry
mee23nu
 
some basics electrical and electronics knowledge
some basics electrical and electronics knowledgesome basics electrical and electronics knowledge
some basics electrical and electronics knowledge
nguyentrungdo88
 
QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)
rccbatchplant
 
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptxExplainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
MahaveerVPandit
 
railway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forgingrailway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forging
Javad Kadkhodapour
 
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
inmishra17121973
 
Introduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptxIntroduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptx
AS1920
 
Degree_of_Automation.pdf for Instrumentation and industrial specialist
Degree_of_Automation.pdf for  Instrumentation  and industrial specialistDegree_of_Automation.pdf for  Instrumentation  and industrial specialist
Degree_of_Automation.pdf for Instrumentation and industrial specialist
shreyabhosale19
 
IntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdfIntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdf
Luiz Carneiro
 
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E..."Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
Infopitaara
 
Value Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous SecurityValue Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous Security
Marc Hornbeek
 
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITYADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ijscai
 
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdffive-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
AdityaSharma944496
 
Artificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptxArtificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptx
aditichinar
 
introduction to machine learining for beginers
introduction to machine learining for beginersintroduction to machine learining for beginers
introduction to machine learining for beginers
JoydebSheet
 
15th International Conference on Computer Science, Engineering and Applicatio...
15th International Conference on Computer Science, Engineering and Applicatio...15th International Conference on Computer Science, Engineering and Applicatio...
15th International Conference on Computer Science, Engineering and Applicatio...
IJCSES Journal
 
Data Structures_Introduction to algorithms.pptx
Data Structures_Introduction to algorithms.pptxData Structures_Introduction to algorithms.pptx
Data Structures_Introduction to algorithms.pptx
RushaliDeshmukh2
 
Smart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineeringSmart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineering
rushikeshnavghare94
 
Metal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistryMetal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistry
mee23nu
 
some basics electrical and electronics knowledge
some basics electrical and electronics knowledgesome basics electrical and electronics knowledge
some basics electrical and electronics knowledge
nguyentrungdo88
 
QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)
rccbatchplant
 
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptxExplainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
MahaveerVPandit
 
railway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forgingrailway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forging
Javad Kadkhodapour
 

Docker Networking - Boulder Linux Users Group (BLUG)

  • 3. What's Docker?  Containerization platform  Provides leaner / application specific virtual machines.  Uses existing kernel features such as namespaces and cgroups  Open source and available on Linux distributions.  Applications are installed on containers packaged, shipped and deployed  This eliminates low level dependencies.
  • 4. How Docker Works? Host Client Registry Docker-client Docker run Docker ps C1 C2 C3 Docker daemon N E T W O R K
  • 5. Docker basic commands  Docker run – Run a container  Docker attach – attach to a running container  Docker info – identify docker version and configuration details  Docker ps – Show currently running containers.  Docker images - list images cached locally.  Docker <command> --help – show command options
  • 6. Docker Single Host Networking NETWORK ON A SINGLE DOCKER HOST
  • 7. Docker Bridge  Docker provides a default bridge "docker0"  By default, all containers are connected to "docker0"  Bridge connects all containers on a single host  Docker network ls – to view existing networks
  • 8. User defined Networks (Bridge)  Docker network create – to create a new network/driver  Docker run –itd –name=container1 –network=<custom bridge name> <image>  Eg: docker network create –driver bridge isolated_nw Option to create a network Create custom driver Custom network name
  • 10. Different Methods of Multihost Networking  Overlay Network  Macvlan  Open virtual switch (OVS)  Standard bridge utilites (brctl)
  • 11. Overlay Concept KV STORE Consul Docker Host 1 Docker Host 2 C1 C2Serf + VXLAN Overlay Network
  • 12. Serf  Created by Hashicorp  Used for orchestration and cluster management  Uses Gossip Protocol  Infrequent UDP messages  Supported on Linux, Mac OS and Windows
  • 13. VXLAN (Virtual Extensible LAN)  Extend VLAN address space.  Used for Overlays to implement Encapsulation over Layer 3 infrastructure  Encapsulates Layer 2 information (VXLAN No.) in Layer 3 Packet. Image sourced from "Arista VXLAN Bridging with DCI Head End Replication" http://www.intelligentvisibility.com/blog/?p=376
  • 14. Steps to create an overlay network 1. Check and update Docker Engine (Latest version 1.12) on hosts. 2. Set up a KV Store 3. Connect hosts to KV store 4. Create an overlay network. 5. Add containers to overlay network 6. Check connectivity between containers
  • 15. Setting up a KV store  We are using a Consul container as a Docker host  It s deployed on an external host.  docker run -d -p 8500:8500 -h consul --name consul progrium/consul -server -bootstrap -p = publish a container's port to host -d = detach/ run in background -h = container hostname  Docker port consul – check port binding
  • 16. Connecting hosts to KV Store  Stop the docker service $ sudo systemctl stop docker.service (RedHat) $ sudo service docker stop  Connect hosts to KV store sudo docker daemon -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock -- cluster-advertise <Net int of host>:2375 --cluster-store consul://<Public IP of host interface>:8500 -H = host --cluster-advertise = send advertisements for cluster on intf:2375 -- cluster-store = IP of KV store/cluster manager
  • 17. Hosts Joining a Cluster
  • 18. Create an overlay Network  On any host: docker network create –d overlay --subnet=<IP address>/<Mask> <network name>
  • 19. Add containers to overlay network  On each of the hosts: docker run –itd --name=<container name> --network=<overlay name> <container image> Docker network inspect <overlay name> (for Verification)
  • 21. Checking connectivity between containers  Ping From C1 to C2 docker exec C2 ping –w5 C1
  • 22. References  Introduction to Docker: https://sysadmincasts.com/episodes/31-introduction-to-docker  Docker Container Networking: https://docs.docker.com/engine/userguide/networking/  Docker Multi-host Network: https://luppeng.wordpress.com/2016/05/03/setting-up-an-overlay-network-on-docker-without-swarm/  Docker Networking Deep Dive (DockerCon 15): https://www.youtube.com/watch?v=vb7U_9AO7Ww  4 Ways to Connect Containers to Local Network http://blog.oddbit.com/2014/08/11/four-ways-to-connect-a-docker/  VXLAN Definition: http://whatis.techtarget.com/definition/VXLAN  Serf https://www.serf.io/  Install Docker on Ubuntu https://docs.docker.com/engine/installation/linux/ubuntulinux/  Install Docker on Centos https://docs.docker.com/engine/installation/linux/centos/

Editor's Notes