Docker/OCI Container for Kubernetes

Part of our "Kubernetes & Cloud" courses

2 days

Docker/Podman For K8S
Outline Last updated:

Course Overview

Master container technologies like Docker, Podman, and CRI-O within the context of Kubernetes clusters. This course focuses on Kubernetes-specific implementations, omitting standalone features like networking, persistence, and resource/health management found in traditional Docker/Podman environments. Perfect for those using containers in Kubernetes.

Who should attend

Developers and DevOps engineers who deploy to Kubernetes, or are about to, and need real container fluency without the standalone Docker material their cluster already replaces. Also for teams already running workloads on Kubernetes who have never been taught what actually happens beneath kubectl.

What you'll learn

  • Run, inspect, debug and troubleshoot containers with confidence
  • Understand container isolation through Linux namespaces, capabilities and non-root execution
  • Understand the OCI image and runtime specifications, image layers and the overlay2 filesystem
  • Build images with Dockerfiles and Containerfiles, using multi-stage builds, cache mounts and build secrets
  • Understand the Container Runtime Interface and how it keeps Kubernetes independent of any one container engine
  • Place Docker, Podman, containerd, CRI-O, runc and crun correctly in the stack

Course Prerequisites

Students should be familiar with general principles of software development. Some basic knowledge of software systems such as databases, web servers, etc is also required. Not a requirement, but having basic linux operating skills is very helpful. No prior knowledge of docker is required.

Outline

Note: This masterclass is tailored for individuals leveraging container technologies specifically within Kubernetes. If you're seeking a comprehensive Docker/Podman course, we recommend our DOCKER-CORE offering. There, you'll dive into essential features for running Docker/Podman independently, including networking, persistence, resource/health management, Compose, and Podman pods.

This comprehensive masterclass covers all the essential fundamentals while also going beyond the basics to explore the underlying technologies that power containerisation, including Linux namespaces, overlay2 filesystems, and the runtime engines like crun/runc. This deep technical approach not only helps students develop a thorough understanding of container technologies at the system level, but also equips them with advanced troubleshooting techniques that aren't typically covered by standard container courses or exposed by the container technologies themselves. Students will gain insight into the low-level mechanisms that make containerisation possible, and leave able to diagnose problems in a cluster rather than guess at them.

We also spend time on the Container Runtime Interface (CRI), the abstraction that lets Kubernetes stay independent of any single container engine. Understanding where Docker, Podman, containerd, CRI-O, runc and crun each sit is what turns a Kubernetes node from a black box into something you can reason about.

Introduction

  • Introduction to Containers
  • Docker history
  • overview of Podman
  • OCI Container technologies (Docker, Moby,Podman, Buildah)
  • Discuss runc/crun in Podman/Docker/Containerd,
  • What problems do containers solve
  • Benefits of using containers
  • Introduce the Open Container Initiative (OCI)
  • Understand container isolation
  • Containers vs virtual machines
  • How containers facilitates devops
  • Installing Docker CE or Podman

Containers

  • Deeper dive into container isolation
  • Introduce Images and the relation with containers
  • Linux Namespaces (PID, UTS, NET, etc) and containers
  • Understand ephemeral containers
  • Discuss the various states of a container (Created, Up, Paused, …)
  • Running and Stopping containers
  • Run detached containers in the background
  • Managing containers (listing, removing, inspecting, killing, pausing, restarting)
  • Discuss go-templates for inspecting containers
  • Interactive containers
  • Executing commands in running containers
  • Copying files and directories to and from containers
  • How to Expose (and map) network ports
  • user management and permissions
  • running containers as non-root
  • adding and dropping Linux Capabilities
  • Introduce use of linux namespaces (e.g, user namespaces in podman)
  • Troubleshooting containers
  • getting information (logs, exit codes, oom kill, …)
  • debugging containers
  • using namespaces to troubleshoot containers
  • Discuss benefits of transient mode (podman)
  • Using systemd

Container Images (OCI)

  • Introduce Container repositories (Docker Hub, Quay.io)
  • Appreciate that images are immutable
  • Understand the Linux overlay2 filesystem and how it is used by containers and images.
  • Managing images (listing, removing, inspecting)
  • Fully understand image layers (including intermediate)
  • List different ways to create images
  • Container images FROM scratch
  • Creating base images (e.g., Debian)
  • Building an image from Containers
  • Using Multi-stage builds

Creating and Using Container Files

  • Building images using different tools (docker, buildkit, buildah)
  • Use docker BuildKit drivers, including building images as pods inside Kubernetes
  • Understand the syntax of a Containerfile/Dockerfile
  • Choosing and specifying a base image
  • Adding meta-data
  • Understand the build process
  • Understand the build context
  • Introduce dockerignore files
  • How to optimise reusing of layers
  • Running commands effectively
  • Understand shell-form and exec-form when running commands
  • Keeping your builds deterministic
  • Copying files and directories
  • improve performance using COPY --link
  • Difference between COPY and ADD
  • Understand the working directory (and changing it)
  • Defining network ports
  • Changing the container's environment
  • Building executable containers
  • Understand how to use ENTRYPOINT and/or CMD
  • Writing entrypoint scripts (e.g, entrypoint.sh) and replacing PID 1
  • Best practices in creating images
  • Using traditional build containers
  • Using multi-stage build files
  • using mounts in dockerfiles (e.g., secrets, *ssh, …)
  • speed-up builds using cache mounts

Frequently asked questions

What is the difference with the full Docker/Podman Masterclass?

This course deliberately leaves out everything Kubernetes provides for you: container networking, volumes and persistence, resource and health management, Docker Compose and Podman pods. What remains is what still matters inside a cluster, covered to the same depth in two days instead of three. If you also run containers standalone, take DOCKER-CORE instead.

Do I need to know Kubernetes before attending?

No, and that is rather the point. This is the course to take before Core Kubernetes Masterclass, so that Kubernetes concepts land on a real understanding of containers rather than on top of a gap.

Do we use Docker or Podman?

Either, and the courseware supports both properly rather than teaching one and mentioning the other. Every command is presented in both forms, so each student can follow along with the tooling that matches their environment.

What are the prerequisites?

General software development experience and some familiarity with systems such as databases and web servers. Basic Linux skills help. No prior container or Kubernetes knowledge is required.

How hands-on is the course?

Three lab sessions across the two days, covering containers, image basics and advanced image building, with more than forty shorter exercises and challenges woven through the slides between them. You work on a real Linux machine throughout, not a simulator.

Do I need to install anything on my laptop?

No. Every student gets their own pre-configured cloud machine, so all you need locally is an SSH client (already present on Linux, macOS and Windows). Work in the editors installed on the machine (vim, LazyVim, Emacs) or connect your own with VS Code Remote Development or IntelliJ's SSH remote development. Login details are emailed a week before the course.

How long is the Docker/OCI Container for Kubernetes course?

2 days, on-site or online. Sessions can run on consecutive days or be spread out to fit your team's schedule.

How large are the groups?

Deliberately small so the trainer can adapt to every participant: at most 10 on-site and 7 online.

In which languages can the course be delivered?

English, French or Dutch.

This Docker/OCI Container for Kubernetes course looks very interesting, I do however have a question

Related courses