Podman: containers without a daemon

Seven 1-hour core lessons plus one optional hour. Rootless containers, images, storage, networking, pods, Compose, Kubernetes YAML, security and Quadlet services.
PodmanOCIContainersEnglish original

中文版

This course teaches Podman in the same format as the Docker course: a 60-minute lesson per hour, with timed modules, commands that you can verify, a sample project, a cheat sheet, a capstone lab and a final quiz. Podman runs OCI containers without a central daemon, and it can run them as an ordinary user. By the end you can build images, run and debug containers, keep data safe, connect services, run multi-container projects, harden them and run them as systemd services.

The Chinese version has the same hours, modules, labs and quizzes, so you can switch languages at the same point in the course.

Who it is for. Engineers who already use containers, or who need to replace Docker on a Linux server or a developer machine. You should know what an image and a container are.

What you need. A Linux machine (a VM is fine), or Windows or macOS with podman machine. Use a throwaway host, not a production server. Every lab works offline except image pulls, which need access to a public registry. Hour 7 needs a Linux user session with systemd.

Version. The course is written for Podman 5.x. Ubuntu 24.04 ships Podman 4.9.3, which uses slirp4netns where Podman 5 uses pasta for rootless networking. Hour 5 shows how to tell which one you have. Check podman --version before you start.

Sample project. All hours use podman-app/, a small Python service in the course folder. Hour 2 builds it. Later hours run it with volumes, networks, Compose, Kubernetes YAML and Quadlet.

Lesson format. Each hour has modules with time windows. Each module explains the mechanism, gives commands with the expected result and a way to verify it, names the common errors, ends with a production note and a 2-question quiz. After class, each hour has a cheat sheet, a capstone lab and a final quiz.

Not included. Unlike the Docker course, this course has no animations, narration audio or embedded videos yet. Diagrams are text diagrams in code blocks.

Status. Draft. Commands were checked against Podman's documentation. The labs have not yet been run end to end on Podman 5.x, so each lab needs one run on a Linux host before the lessons are approved.

Full outline and time allocation

HourTimeModuleMinutes
1 Core fundamentalsbefore classModule 0: setuppre-class
100–08m1 Architecture and rootless8
108–16m2 Images and registries8
116–28m3 Run, list, stop and remove12
128–38m4 Logs, exec and inspect10
138–50m5 Docker compatibility and podman machine12
150–60m6 Lab: your first web service10
2 Images and building00–08m1 Image internals8
208–20m2 Containerfile instructions12
220–30m3 Build cache and .containerignore10
230–42m4 Multi-stage builds and non-root users12
242–52m5 Registries: login, tag and push10
252–60m6 Save, load and clean up8
3 Running containers well00–10m1 Environment and configuration10
310–20m2 Resource limits10
320–28m3 Restart policies8
328–40m4 Health checks12
340–52m5 Stop, signals and exit codes12
352–60m6 Diagnose a crash loop8
4 Storage00–08m1 Writable layer, volumes and bind mounts8
408–18m2 Named volumes10
418–28m3 Bind mounts and SELinux labels10
428–40m4 Rootless ownership: keep-id and unshare12
440–52m5 Backup and restore12
452–60m6 Production data rules8
5 Networking and pods00–10m1 Network modes and rootless networking10
510–20m2 User-defined networks and DNS10
520–32m3 Publishing ports12
532–44m4 Pods12
544–54m5 Connectivity troubleshooting10
554–60m6 Production network layout6
6 Compose and Kubernetes YAML00–10m1 podman compose10
610–22m2 A multi-service project12
622–32m3 Generate Kubernetes YAML10
632–44m4 Play and tear down Kubernetes YAML12
644–52m5 Choose Compose, kube play or Quadlet8
652–60m6 Migration checklist8
7 Security and services00–10m1 Rootless internals: subuid and uid_map10
710–22m2 Least privilege at run time12
722–30m3 Secrets8
730–40m4 Image trust and digest pinning10
740–52m5 Quadlet: containers as systemd services12
752–60m6 Auto-update, rollback and reboot test8
8 (optional) Troubleshooting and interviews00–10m1 Error catalogue10
810–20m2 Diagnostic toolkit10
820–30m3 Walk through two failures10
830–44m4 Fifty production problems14
844–60m5 Fifty interview questions16

Knowledge coverage matrix

Each row is a skill, the module that teaches it, the main command, and the lab that proves it works. Use it to check for gaps.

SkillModuleMain commandLab
Daemonless and rootless modelH1 m1podman infoH1 m6
Pull and name imagesH1 m2, H2 m1podman pull, podman images --digestsH1 m6
Run, list, stop and remove containersH1 m3podman run, podman ps -a, podman rmH1 m6
Logs, exec and inspectH1 m4podman logs, podman exec, podman inspectH1 m6
Docker compatibilityH1 m5alias docker=podman, podman system serviceH1 m5
Build from a ContainerfileH2 m2, m3podman buildH2 capstone
Multi-stage and non-root imagesH2 m4podman build, USERH2 m4
Push and pull through a registryH2 m5podman login, podman pushH2 capstone
Save, load and reclaim diskH2 m6podman save, podman system df, podman image pruneH2 m6
Environment and configurationH3 m1podman run -e --env-fileH3 m6
Resource limitsH3 m2podman run --memory --cpus --pids-limit, podman statsH3 m2
Restart policies and their limitsH3 m3podman run --restartH3 m3
Health checksH3 m4podman healthcheck runH3 m4
Signals and exit codesH3 m5podman stop -t, podman killH3 m5
Named volumes and bind mountsH4 m2, m3podman volume create, -v, :ZH4 capstone
Rootless file ownershipH4 m4--userns=keep-id, podman unshareH4 m4
Backup and restore of volumesH4 m5podman volume export, podman volume importH4 m5
Network modes and DNS by nameH5 m1, m2podman network create, --networkH5 m2
Publishing portsH5 m3-p 127.0.0.1:host:containerH5 m3
PodsH5 m4podman pod create, --podH5 m4
Compose projectsH6 m1, m2podman compose up, podman compose execH6 m2
Kubernetes YAMLH6 m3, m4podman kube generate, podman kube play, podman kube downH6 m4
Rootless user IDsH7 m1/etc/subuid, podman unshare cat /proc/self/uid_mapH7 m1
Least privilegeH7 m2--user, --cap-drop, --read-only, --security-optH7 m2
SecretsH7 m3podman secret create, --secretH7 m3
Digest pinningH7 m4image@sha256:...H7 m4
Quadlet servicesH7 m5.container files, systemctl --userH7 m5
Auto-update and rollbackH7 m6AutoUpdate=registry, podman auto-updateH7 m6
Diagnosis and production problemsH8podman logs, podman inspect, podman eventsH8 m3

Schedule

Hour 1: Core fundamentals
Core hour · How Podman works without a daemon, images and registries, the container lifecycle, logs and inspection, and how Podman relates to Docker.
Hour 2: Images and building
Core hour · What an image is made of, Containerfile instructions, build cache, multi-stage and non-root images, pushing to a registry, and saving and cleaning up images.
Hour 3: Running containers well
Core hour · Configuration with environment variables, resource limits, restart policies and their limits, health checks, clean stops with signals and exit codes, and diagnosing a crash loop.
Hour 4: Storage: volumes and bind mounts
Core hour · Where container data lives, named volumes, bind mounts with SELinux labels, file ownership for rootless containers, backup and restore, and data rules for production.
Hour 5: Networking and pods
Core hour · Network modes, the rootless networking helper (pasta or slirp4netns), user-defined networks with DNS by name, publishing ports safely, pods, connectivity troubleshooting and production network layouts.
Hour 6: Compose and Kubernetes YAML
Core hour · Multi-service projects with podman compose, generating and replaying Kubernetes YAML with kube generate, kube play and kube down, choosing between Compose, kube play and Quadlet, and a migration checklist.
Hour 7: Security and running as services
Core hour · Rootless user IDs, least privilege at run time, secrets, image trust and digest pinning, Quadlet services under systemd, and auto-update with rollback.
Hour 8: Troubleshooting, 50 production problems and 50 interview questions
Optional ninth hour · Optional. Read common Podman errors, run the diagnostic commands in order, walk through two failures, review 50 production problems with their fixes, and answer 50 interview questions.