From a45ec1cb84e7790b7a08b200c7f50ac7d7fbc989 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Petazzoni?= Date: Tue, 7 Nov 2017 22:41:32 -0800 Subject: [PATCH] Reorg intro material a bit --- slides/intro-fullday.yml | 12 ++- slides/intro/Container_Network_Model.md | 6 +- slides/intro/Container_Networking_Basics.md | 81 ------------------ ...Install_Docker.md => Installing_Docker.md} | 2 +- slides/intro/Network_Drivers.md | 84 +++++++++++++++++++ ...b_Tease.md => Publishing_To_Docker_Hub.md} | 0 slides/workshop.css | 11 ++- 7 files changed, 104 insertions(+), 92 deletions(-) rename slides/intro/{Install_Docker.md => Installing_Docker.md} (99%) create mode 100644 slides/intro/Network_Drivers.md rename slides/intro/{Docker_Hub_Tease.md => Publishing_To_Docker_Hub.md} (100%) diff --git a/slides/intro-fullday.yml b/slides/intro-fullday.yml index b349645d..215d494f 100644 --- a/slides/intro-fullday.yml +++ b/slides/intro-fullday.yml @@ -1,4 +1,7 @@ -title: "Introduction to Docker and Containers" +title: | + Introduction + to Docker and + Containers chat: "[Slack](https://dockercommunity.slack.com/messages/C7GKACWDV)" #chat: "[Gitter](https://gitter.im/jpetazzo/workshop-yyyymmdd-city)" @@ -13,7 +16,7 @@ chapters: - - intro/Docker_Overview.md #- intro/Docker_History.md - intro/Training_Environment.md - - intro/Install_Docker.md + - intro/Installing_Docker.md - intro/First_Containers.md - intro/Background_Containers.md - intro/Start_And_Attach.md @@ -23,15 +26,16 @@ chapters: - intro/Cmd_And_Entrypoint.md - intro/Copying_Files_During_Build.md - intro/Multi_Stage_Builds.md + - intro/Publishing_To_Docker_Hub.md - intro/Dockerfile_Tips.md - #- intro/Advanced_Dockerfiles.md - - intro/Docker_Hub_Tease.md - - intro/Naming_And_Inspecting.md - intro/Container_Networking_Basics.md + - intro/Network_Drivers.md - intro/Container_Network_Model.md #- intro/Connecting_Containers_With_Links.md - intro/Ambassadors.md - - intro/Local_Development_Workflow.md - intro/Working_With_Volumes.md - intro/Compose_For_Dev_Stacks.md + - intro/Advanced_Dockerfiles.md - common/thankyou.md diff --git a/slides/intro/Container_Network_Model.md b/slides/intro/Container_Network_Model.md index 500a225e..b465af51 100644 --- a/slides/intro/Container_Network_Model.md +++ b/slides/intro/Container_Network_Model.md @@ -174,7 +174,7 @@ In Docker Engine 1.10, this has been replaced by a dynamic resolver. --- -## Connecting multiple containers together +# Service discovery with containers * Let's try to run an application that requires two containers. @@ -210,9 +210,7 @@ $ docker ps -l * If we connect to the application now, we will see an error page: -.small[ ![Trainingwheels error](images/trainingwheels-error.png) -] * This is because the Redis service is not running. * This container tries to resolve the name `redis`. @@ -241,9 +239,7 @@ $ docker run --net dev --name redis -d redis * If we connect to the application now, we should see that the app is working correctly: -.small[ ![Trainingwheels OK](images/trainingwheels-ok.png) -] * When the app tries to resolve `redis`, instead of getting a DNS error, it gets the IP address of our Redis container. diff --git a/slides/intro/Container_Networking_Basics.md b/slides/intro/Container_Networking_Basics.md index ad937409..ddc0d19b 100644 --- a/slides/intro/Container_Networking_Basics.md +++ b/slides/intro/Container_Networking_Basics.md @@ -189,87 +189,6 @@ $ ping --- -## The different network drivers - -A container can use one of the following drivers: - -* `bridge` (default) -* `none` -* `host` -* `container` - -The driver is selected with `docker run --net ...`. - -The different drivers are explained with more details on the following slides. - ---- - -## The default bridge - -* By default, the container gets a virtual `eth0` interface. -
(In addition to its own private `lo` loopback interface.) - -* That interface is provided by a `veth` pair. - -* It is connected to the Docker bridge. -
(Named `docker0` by default; configurable with `--bridge`.) - -* Addresses are allocated on a private, internal subnet. -
(Docker uses 172.17.0.0/16 by default; configurable with `--bip`.) - -* Outbound traffic goes through an iptables MASQUERADE rule. - -* Inbound traffic goes through an iptables DNAT rule. - -* The container can have its own routes, iptables rules, etc. - ---- - -## The null driver - -* Container is started with `docker run --net none ...` - -* It only gets the `lo` loopback interface. No `eth0`. - -* It can't send or receive network traffic. - -* Useful for isolated/untrusted workloads. - ---- - -## The host driver - -* Container is started with `docker run --net host ...` - -* It sees (and can access) the network interfaces of the host. - -* It can bind any address, any port (for ill and for good). - -* Network traffic doesn't have to go through NAT, bridge, or veth. - -* Performance = native! - -Use cases: - -* Performance sensitive applications (VOIP, gaming, streaming...) - -* Peer discovery (e.g. Erlang port mapper, Raft, Serf...) - ---- - -## The container driver - -* Container is started with `docker run --net container:id ...` - -* It re-uses the network stack of another container. - -* It shares with this other container the same interfaces, IP address(es), routes, iptables rules, etc. - -* Those containers can communicate over their `lo` interface. -
(i.e. one can bind to 127.0.0.1 and the others can connect to it.) - ---- - ## Section summary We've learned how to: diff --git a/slides/intro/Install_Docker.md b/slides/intro/Installing_Docker.md similarity index 99% rename from slides/intro/Install_Docker.md rename to slides/intro/Installing_Docker.md index e522bf3b..0ec57cb1 100644 --- a/slides/intro/Install_Docker.md +++ b/slides/intro/Installing_Docker.md @@ -1,7 +1,7 @@ class: title -# Install Docker +# Installing Docker ![install](images/install.jpg) diff --git a/slides/intro/Network_Drivers.md b/slides/intro/Network_Drivers.md new file mode 100644 index 00000000..b39c5e6e --- /dev/null +++ b/slides/intro/Network_Drivers.md @@ -0,0 +1,84 @@ +# Container Network Drivers + +The Docker Engine supports many different network drivers. + +The built-in drivers include: + +* `bridge` (default) + +* `none` + +* `host` + +* `container` + +The driver is selected with `docker run --net ...`. + +The different drivers are explained with more details on the following slides. + +--- + +## The default bridge + +* By default, the container gets a virtual `eth0` interface. +
(In addition to its own private `lo` loopback interface.) + +* That interface is provided by a `veth` pair. + +* It is connected to the Docker bridge. +
(Named `docker0` by default; configurable with `--bridge`.) + +* Addresses are allocated on a private, internal subnet. +
(Docker uses 172.17.0.0/16 by default; configurable with `--bip`.) + +* Outbound traffic goes through an iptables MASQUERADE rule. + +* Inbound traffic goes through an iptables DNAT rule. + +* The container can have its own routes, iptables rules, etc. + +--- + +## The null driver + +* Container is started with `docker run --net none ...` + +* It only gets the `lo` loopback interface. No `eth0`. + +* It can't send or receive network traffic. + +* Useful for isolated/untrusted workloads. + +--- + +## The host driver + +* Container is started with `docker run --net host ...` + +* It sees (and can access) the network interfaces of the host. + +* It can bind any address, any port (for ill and for good). + +* Network traffic doesn't have to go through NAT, bridge, or veth. + +* Performance = native! + +Use cases: + +* Performance sensitive applications (VOIP, gaming, streaming...) + +* Peer discovery (e.g. Erlang port mapper, Raft, Serf...) + +--- + +## The container driver + +* Container is started with `docker run --net container:id ...` + +* It re-uses the network stack of another container. + +* It shares with this other container the same interfaces, IP address(es), routes, iptables rules, etc. + +* Those containers can communicate over their `lo` interface. +
(i.e. one can bind to 127.0.0.1 and the others can connect to it.) + diff --git a/slides/intro/Docker_Hub_Tease.md b/slides/intro/Publishing_To_Docker_Hub.md similarity index 100% rename from slides/intro/Docker_Hub_Tease.md rename to slides/intro/Publishing_To_Docker_Hub.md diff --git a/slides/workshop.css b/slides/workshop.css index 7e15cb25..e500a81b 100644 --- a/slides/workshop.css +++ b/slides/workshop.css @@ -99,13 +99,17 @@ div.pic img { max-width: 1210px; max-height: 681px; } +div.pic h1, div.pic h2, div.title h1, div.title h2 { + text-align: center; +} /* Center images that are on title slides */ div.title img { display: block; margin: auto; + max-width: 1210px; + max-height: 420px; /* Arbitrary value to have so space for the title */ } - div.title { vertical-align: middle; } @@ -114,6 +118,11 @@ div.title > p:first-child { font-size: 300%; } +div img { + max-width: 1210px; + max-height: 250px; +} + .nav { text-align: center; position: absolute;