diff --git a/slides/containers/Exercise_Composefile.md b/slides/containers/Exercise_Composefile.md new file mode 100644 index 00000000..703b21b2 --- /dev/null +++ b/slides/containers/Exercise_Composefile.md @@ -0,0 +1,5 @@ +# Exercise — writing a Compose file + +Let's write a Compose file for the wordsmith app! + +The code is at: https://github.com/jpetazzo/wordsmith diff --git a/slides/containers/Exercise_Dockerfile_Advanced.md b/slides/containers/Exercise_Dockerfile_Advanced.md new file mode 100644 index 00000000..0ca16d75 --- /dev/null +++ b/slides/containers/Exercise_Dockerfile_Advanced.md @@ -0,0 +1,9 @@ +# Exercise — writing better Dockerfiles + +Let's update our Dockerfiles to leverage multi-stage builds! + +The code is at: https://github.com/jpetazzo/wordsmith + +Use a different tag for these images, so that we can compare their sizes. + +What's the size difference between single-stage and multi-stage builds? diff --git a/slides/containers/Exercise_Dockerfile_Basic.md b/slides/containers/Exercise_Dockerfile_Basic.md new file mode 100644 index 00000000..c6cad7b4 --- /dev/null +++ b/slides/containers/Exercise_Dockerfile_Basic.md @@ -0,0 +1,5 @@ +# Exercise — writing Dockerfiles + +Let's write Dockerfiles for an existing application! + +The code is at: https://github.com/jpetazzo/wordsmith diff --git a/slides/containers/First_Containers.md b/slides/containers/First_Containers.md index aa47a764..21d8e6f4 100644 --- a/slides/containers/First_Containers.md +++ b/slides/containers/First_Containers.md @@ -203,4 +203,90 @@ bash: figlet: command not found * The basic Ubuntu image was used, and `figlet` is not here. -* We will see in the next chapters how to bake a custom image with `figlet`. +--- + +## Where's my container? + +* Can we reuse that container that we took time to customize? + + *We can, but that's not the default workflow with Docker.* + +* What's the default workflow, then? + + *Always start with a fresh container.* +
+ *If we need something installed in our container, build a custom image.* + +* That seems complicated! + + *We'll see that it's actually pretty easy!* + +* And what's the point? + + *This puts a strong emphasis on automation and repeatability. Let's see why ...* + +--- + +## Pets vs. Cattle + +* In the "pets vs. cattle" metaphor, there are two kinds of servers. + +* Pets: + + * have distinctive names and unique configurations + + * when they have an outage, we do everything we can to fix them + +* Cattle: + + * have generic names (e.g. with numbers) and generic configuration + + * configuration is enforced by configuration management, golden images ... + + * when they have an outage, we can replace them immediately with a new server + +* What's the connection with Docker and containers? + +--- + +## Local development environments + +* When we use local VMs (with e.g. VirtualBox or VMware), our workflow looks like this: + + * create VM from base template (Ubuntu, CentOS...) + + * install packages, set up environment + + * work on project + + * when done, shutdown VM + + * next time we need to work on project, restart VM as we left it + + * if we need to tweak the environment, we do it live + +* Over time, the VM configuration evolves, diverges. + +* We don't have a clean, reliable, deterministic way to provision that environment. + +--- + +## Local development with Docker + +* With Docker, the workflow looks like this: + + * create container image with our dev environment + + * run container with that image + + * work on project + + * when done, shutdown container + + * next time we need to work on project, start a new container + + * if we need to tweak the environment, we create a new image + +* We have a clear definition of our environment, and can share it reliably with others. + +* Let's see in the next chapters how to bake a custom image with `figlet`! diff --git a/slides/containers/Initial_Images.md b/slides/containers/Initial_Images.md index 8c6a5475..0e601e57 100644 --- a/slides/containers/Initial_Images.md +++ b/slides/containers/Initial_Images.md @@ -70,8 +70,9 @@ class: pic * An image is a read-only filesystem. -* A container is an encapsulated set of processes running in a - read-write copy of that filesystem. +* A container is an encapsulated set of processes, + + running in a read-write copy of that filesystem. * To optimize container boot time, *copy-on-write* is used instead of regular copy. @@ -177,8 +178,11 @@ Let's explain each of them. ## Root namespace -The root namespace is for official images. They are put there by Docker Inc., -but they are generally authored and maintained by third parties. +The root namespace is for official images. + +They are gated by Docker Inc. + +They are generally authored and maintained by third parties. Those images include: @@ -188,7 +192,7 @@ Those images include: * Ready-to-use components and services, like redis, postgresql... -* Over 130 at this point! +* Over 150 at this point! --- diff --git a/slides/containers/Orchestration_Overview.md b/slides/containers/Orchestration_Overview.md index 986d70a3..1ab25a80 100644 --- a/slides/containers/Orchestration_Overview.md +++ b/slides/containers/Orchestration_Overview.md @@ -6,8 +6,6 @@ In this chapter, we will: * Present (from a high-level perspective) some orchestrators. -* Show one orchestrator (Kubernetes) in action. - --- class: pic diff --git a/slides/intro-fullday.yml b/slides/intro-fullday.yml index 98281b5b..b137fb59 100644 --- a/slides/intro-fullday.yml +++ b/slides/intro-fullday.yml @@ -30,27 +30,11 @@ chapters: - containers/Building_Images_With_Dockerfiles.md - containers/Cmd_And_Entrypoint.md - - containers/Copying_Files_During_Build.md - - | - # Exercise — writing Dockerfiles - - Let's write Dockerfiles for an existing application! - - The code is at: https://github.com/jpetazzo/wordsmith - + - containers/Exercise_Dockerfile_Basic.md - containers/Multi_Stage_Builds.md - containers/Publishing_To_Docker_Hub.md - containers/Dockerfile_Tips.md - - | - # Exercise — writing better Dockerfiles - - Let's update our Dockerfiles to leverage multi-stage builds! - - The code is at: https://github.com/jpetazzo/wordsmith - - Use a different tag for these images, so that we can compare their sizes. - - What's the size difference between single-stage and multi-stage builds? - + - containers/Exercise_Dockerfile_Advanced.md - - containers/Naming_And_Inspecting.md - containers/Labels.md - containers/Getting_Inside.md @@ -64,13 +48,7 @@ chapters: - containers/Windows_Containers.md - containers/Working_With_Volumes.md - containers/Compose_For_Dev_Stacks.md - - | - # Exercise — writing a Compose file - - Let's write a Compose file for the wordsmith app! - - The code is at: https://github.com/jpetazzo/wordsmith - + - containers/Exercise_Composefile.md - - containers/Docker_Machine.md - containers/Advanced_Dockerfiles.md - containers/Application_Configuration.md diff --git a/slides/intro-selfpaced.yml b/slides/intro-selfpaced.yml index 6020ed78..5ebc32c5 100644 --- a/slides/intro-selfpaced.yml +++ b/slides/intro-selfpaced.yml @@ -30,9 +30,11 @@ chapters: - containers/Building_Images_With_Dockerfiles.md - containers/Cmd_And_Entrypoint.md - containers/Copying_Files_During_Build.md + - containers/Exercise_Dockerfile_Basic.md - - containers/Multi_Stage_Builds.md - containers/Publishing_To_Docker_Hub.md - containers/Dockerfile_Tips.md + - containers/Exercise_Dockerfile_Advanced.md - - containers/Naming_And_Inspecting.md - containers/Labels.md - containers/Getting_Inside.md @@ -45,6 +47,7 @@ chapters: - containers/Windows_Containers.md - containers/Working_With_Volumes.md - containers/Compose_For_Dev_Stacks.md + - containers/Exercise_Composefile.md - containers/Docker_Machine.md - - containers/Advanced_Dockerfiles.md - containers/Application_Configuration.md diff --git a/slides/k8s/cluster-upgrade.md b/slides/k8s/cluster-upgrade.md index 57bce466..48197842 100644 --- a/slides/k8s/cluster-upgrade.md +++ b/slides/k8s/cluster-upgrade.md @@ -166,7 +166,7 @@ - Upgrade kubelet: ```bash - apt install kubelet=1.14.1-00 + apt install kubelet=1.14.2-00 ``` ] @@ -267,7 +267,7 @@ - Perform the upgrade: ```bash - sudo kubeadm upgrade apply v1.14.1 + sudo kubeadm upgrade apply v1.14.2 ``` ] @@ -287,8 +287,8 @@ - Download the configuration on each node, and upgrade kubelet: ```bash for N in 1 2 3; do - ssh node$N sudo kubeadm upgrade node config --kubelet-version v1.14.1 - ssh node $N sudo apt install kubelet=1.14.1-00 + ssh node$N sudo kubeadm upgrade node config --kubelet-version v1.14.2 + ssh node $N sudo apt install kubelet=1.14.2-00 done ``` ] @@ -297,7 +297,7 @@ ## Checking what we've done -- All our nodes should now be updated to version 1.14.1 +- All our nodes should now be updated to version 1.14.2 .exercise[ diff --git a/slides/k8s/localkubeconfig.md b/slides/k8s/localkubeconfig.md index eaaf9e4e..116a39fa 100644 --- a/slides/k8s/localkubeconfig.md +++ b/slides/k8s/localkubeconfig.md @@ -16,11 +16,11 @@ - Download the `kubectl` binary from one of these links: - [Linux](https://storage.googleapis.com/kubernetes-release/release/v1.14.1/bin/linux/amd64/kubectl) + [Linux](https://storage.googleapis.com/kubernetes-release/release/v1.14.2/bin/linux/amd64/kubectl) | - [macOS](https://storage.googleapis.com/kubernetes-release/release/v1.14.1/bin/darwin/amd64/kubectl) + [macOS](https://storage.googleapis.com/kubernetes-release/release/v1.14.2/bin/darwin/amd64/kubectl) | - [Windows](https://storage.googleapis.com/kubernetes-release/release/v1.14.1/bin/windows/amd64/kubectl.exe) + [Windows](https://storage.googleapis.com/kubernetes-release/release/v1.14.2/bin/windows/amd64/kubectl.exe) - On Linux and macOS, make the binary executable with `chmod +x kubectl` diff --git a/slides/k8s/versions-k8s.md b/slides/k8s/versions-k8s.md index e093d20a..ab76efed 100644 --- a/slides/k8s/versions-k8s.md +++ b/slides/k8s/versions-k8s.md @@ -1,7 +1,7 @@ ## Versions installed -- Kubernetes 1.14.1 -- Docker Engine 18.09.5 +- Kubernetes 1.14.2 +- Docker Engine 18.09.6 - Docker Compose 1.21.1