Académique Documents
Professionnel Documents
Culture Documents
VN NH PHC
TRN HU CNG
NGUYN VN THNG
Introduction
Networking Deep Dive (version 1.7)
Networking Deep Dive (Experimental)
Ecosystem
Q&A
2015
WHAT IS DOCKER ?
2015
DOCKER0 BRIDGE
a pair of peer interfaces that are like opposite ends of a pipe a packet sent on one will
be received on the other
It gives one of the peers to the container to become its eth0 interface and keeps the other
peer, with a unique name like veth37c1271
Docker Host
db wp01
/etc/host
WORDPRESS_DB_
Wpuser NAME=wpdb
Wpdb
WORDPRESS_DB_
wppwd USER=wpuser
docker run --name db -d -e MYSQL_ROOT_PASSWORD=Memzoh78 WORDPRESS_DB_P
ASSWORD=wppw
-e MYSQL_DATABASE=wpdb -e MYSQL_USER=wpuser -e d
MYSQL_PASSWORD=wppwd mysql
3306/tcp Mysql: 80/tcp
docker run --name wp01 --link db:mysql -d -e // eth0
eth0
WORDPRESS_DB_NAME=wpdb -e WORDPRESS_DB_USER=wpuser
-e WORDPRESS_DB_PASSWORD=wppwd -p 8080:80 wordpress Iptables 8080/tcp
eth0
HN - 7/17/2015
DOCKERDAY VIET NAM - 2015
HOW DOCKER NETWORKS A CONTAINER ?
Docker Host
wppwd docker0
3306/tcp
--net=container:NAME_or_ID
eth0 Veth***
--net=none
L0
L0 eth0
with Docker v.1.2.0, you can now edit /etc/hosts, /etc/hostname and /etc/resolve.conf in a
running container
changes to these files will not be saved by docker commit nor will they be saved during
docker run
wont be saved in the image, nor will they persist when a container is restarted
2015
Why is Networking important?
Multi-host Networking
Services UI
blue = experimental
What is Libnetwork
Driver-based networking
Network
Sandbox
Defer to
Driver
Create
Network
Defer to
Driver
Create
Container
Libnetwork API
libnetwork.New
controller.ConfigureNetworkDriver
controller.NewNetwork
network.CreateEndpoint
endpoint.Join
RESTful API
/network
/network/<network_id>/endpoints
/network/<network_id>/endpoints/<endpoint_id>
/network/<network_id>/endpoints/<endpoint_id>/containers
/services
/services/<service_id>
/services/<service_id>/backends
Drivers
Contribute to libnetwork
Raise an Issue or Submit a Pull Request