Skip to content
Français
Account: not signed in, sync available My learning
Select theme
Français

Docker tutorial: the guide to learn Docker from A to Z

  • 25 min

By updated

Improve this page

Logo Docker

Docker is the reference containerization platform: it lets you package an application and its dependencies into an image, an immutable artifact, then run it anywhere in the same way as a container, a lightweight isolated process that starts in a few seconds. This settles the famous "it works on my machine": the container carries everything it needs to run, from the code to the system libraries.

This page opens the Docker course: it explains how the course is organized, module by module, then gives you a quick reference to come back to a command or a choice.

What do you need to know before starting?

The Docker course assumes that you already know what a container is and that you are comfortable in a Linux terminal. The first prerequisite comes from the Introduction to containerization course (in French), the second from the Linux course.

The Introduction to containerization course makes you understand that a container is an ordinary process of the machine, to which the kernel gives a restricted view of the system. Namespaces isolate what it sees, and cgroups cap what it consumes: you create them by hand in A container by hand with unshare and nsenter (in French), then in Limit a container: cgroups v2 and capabilities. You also learn the difference with a virtual machine there: a virtual machine emulates a complete computer with its own kernel, whereas a container shares the host kernel, which explains why it starts in a few seconds.

An OCI image is a standardized archive that provides a container's filesystem and its starting configuration. It is studied with Understanding OCI: tag, digest, manifest, multi-arch and artifacts and Read an OCI image and verify its digest (in French).

A runtime such as runc then executes this image by reproducing the kernel operations seen earlier, in Run an OCI bundle with runc (in French). The lesson Runtime, engine, orchestrator: who does what (in French) then places Docker relative to it.

On the Linux side, the Docker course only uses a small foundation, detailed on the home page of the Linux course: navigating and editing files in a terminal, reading and changing the permissions of a file and a user, listing and stopping processes, and understanding basic networking (IP address, port, name resolution). These notions come back in the modules on volumes, clean container shutdown and port publishing.

If you lack these foundations, first follow the Introduction to containerization course, then go back over the Linux modules that match what blocks you, before returning here.

How is the Docker course organized?

The course has fourteen teaching modules, split into three levels: "Use Docker" (run, build, publish, observe, connect and persist), "Compose and operate an application" (Compose), then "Build, harden and industrialize" (advanced images, engine, hardening, image pipeline). The modules follow a recommended reading order, and your progress lesson by lesson is tracked on the My path page.

All the commands in the course are measured on Docker Engine 29.9.2, Compose 5.6.1 and Buildx 0.38.1, installed on Debian 13.

The durations quoted below are those of the programme: each lesson carries its own, and a module announces the sum of its published lessons. Every lesson and exam of the programme has a published page, and three guides of the third level are being rewritten. This page only links published lessons, and points out in each module the guides that are being rewritten.

Discover Docker and run a container

This first module (about 2 h 45) lays out what a container is before running one. The lesson Containers or virtual machines: which one to choose? compares the two models, then Images, containers and registries: the anatomy traces the path from a docker command to the process. You then install Docker Engine 29 and prove it works, and learn to run a container and choose what it runs. The exam "get a service running" closes the module.

Build and publish an image

A container starts from an image, and this module (about 3 h 25) teaches you to build it and then publish it. It starts with Write a Dockerfile, then choose and maintain a base image. It continues with Docker USER, which explains how to run an image as non-root without breaking it, and with the organization of layers and the build cache. The lesson Publish and pull an image has you name the image, log in with a limited-rights token, then push it and pull it back by tag or by digest. The exam "ship a first image" checks it all.

Observe and troubleshoot a container

This module (about 2 h 20) is about understanding why a container stops, restarts or refuses to start. The lifecycle, PID 1 and clean shutdown explain the states and the exit codes 137 and 143. Inspect a running container gives four commands for four questions, and Read a startup failure teaches how to interpret the codes 125, 126 and 127 and restart loops. The exam "bring three containers back into service" puts you in a real situation.

Expose and connect containers

This module (about 2 h 10) deals with what is open, and to whom. Publish a port without exposing the whole host distinguishes the three forms of -p. Next, the default network or a network of your own shows that only a network you create resolves container names, and isolating a container from the network compares none and the internal network. The exam "expose an application without exposing its database" proves it.

Keep your data

A recreated container loses its files: this module (about 1 h 35) teaches you to keep them. The lesson Docker volumes compares named volume, bind mount and tmpfs. The one on volume permissions sorts out the three causes of an access denied. You finish with the exam "bring a container back into service".

Describe an application with Compose

This module (about 3 h 15) opens the second level: you move from several docker run commands to a single file. The lesson Describe an application with Compose sets up two services, a network and a volume. It is followed by interpolation and environment files, the organization of a stack's networks and the persistence of the data of a recreated stack. The exam "bring a stack back into service" concludes it.

Make a stack reliable

A stack that starts is not yet a reliable stack, and this module (about 3 h 45) takes care of that. You inject secrets while knowing their limits, you set up startup, readiness and health, you bound resources and restarts, then you write explicit variants for development and deployment. The exam "make a stack reliable" checks these settings.

Operate and restore a stack

This module (about 2 h 45) ends the second level. It teaches you to read logs and attribute saturation, to back up and restore an application, then to update a stack and roll back without losing data. The exam "operate and restore a stack" closes the module and the level.

Build advanced images

The third level opens with this module (about 6 h 15), which takes up image building where the first level stopped. You start by reading an OCI image and its identity: tag, index, manifest, digest and platform. You then learn to change base without breaking the application, then to separate build from runtime with a multi-stage build. The lesson BuildKit: build secrets and private access covers build secrets, and the one on multi-architecture covers buildx and emulation. The exam "rebuild an image for two architectures" checks the result.

Test, shrink and ship an image

This module teaches you to decide that an image is ready, then to ship it. Its five lessons and its exam add up to about 5 h 35. You test the contract of an image with a script that rejects it if it is unusable, then you shrink its size. You then serve a trusted registry and log in to it, you pin a base and ship offline with docker save, then you export an image without a daemon with Skopeo. The exam "deliver an image usable elsewhere" checks that a bare client runs your delivery.

Understand what the engine does

This module explains what really happens when a container starts. Its four lessons and its exam add up to about 2 h 50. You start by measuring a container's isolation with namespaces and cgroups, then you follow the execution chain from the docker client down to runc. The lesson Cap a container then tunes the processor, the ulimits and the shared memory, and Cap memory and the number of tasks of a container teaches you to set these two ceilings, read their effect in the cgroup and recognize an OOM or a task saturation. The exam "contain a runaway container" closes the module.

Administer the daemon

The Docker daemon is the element that all your applications share, and this module teaches you to look after it. Its five published lessons and its exam add up to about 4 h 25. The guide Configure the Docker daemon (in French), which covers daemon.json, logs, storage and registry mirrors, is being rewritten. The lesson Put a proxy in front of the Docker API (about 40 min) shows why mounting docker.sock as :ro does not protect.

The lesson Rotate Docker logs and reclaim disk space (about 30 min) bounds a container's logs, proves that rotation happens, measures space by category and frees a full filesystem without recreating the container. The lesson Upgrade Docker Engine and back up its configuration (about 35 min) upgrades Docker Engine from one version to the next on a host whose packages are held, with live-restore and a witness piece of data, then rolls back. The lesson Remove direct access to the Docker daemon (about 45 min) lists who can talk to the Docker socket, through the docker group, an ACL or a mount inside a container, then removes each access and checks that it is really closed. The lesson Run Docker in rootless mode (about 55 min) installs an engine under an unprivileged account next to the system engine, reads the UID mapping, measures what changes for networking, resources and AppArmor, then keeps the daemon running without an open session. The exam "take over a Docker host" (about 60 min) closes the module: a host left unmaintained, to take over without losing its named volumes.

Harden the execution

This module aims to reduce what a compromised container can do. Its four published lessons and its exam add up to about 4 h 25. Two published guides are being rewritten: Securing Docker in production, which covers the Docker socket, --privileged, capabilities, seccomp profiles, AppArmor and SELinux, read-only mode, resource limits and rootless mode, and Manage secrets (in French), which avoids exposing tokens and passwords in images. The lesson Read-only root filesystem, and a shutdown without data loss (about 50 min) freezes the root of a PostgreSQL container with --read-only, bounds its tmpfs mounts, prepares its volume, then compares docker stop and docker kill on a transaction in progress. The lesson Find orphan Docker volumes without deleting everything (about 60 min) finds a volume that is no longer attached, reads it safely and backs it up, reattaches it to Compose after a project rename, then removes only what is disposable. The lesson Seccomp and AppArmor profiles for Docker containers (about 60 min) reads a container's active profiles, attributes a denial to its layer, derives a seccomp profile from the default one and writes an AppArmor profile that still lets the service stop cleanly and survives a reboot. The lesson Diagnose Docker network and firewall issues (about 35 min) follows a packet to the container, locates the hop and the rule that refuse it, fixes one rule and proves it with positive and negative probes, without ever disabling the firewall. The exam "harden a service without breaking it" (about 60 min) closes the module.

Industrialize the image pipeline

The last module puts image building into production. The lesson Automate the build, tests and publication of an image (about 40 min) writes a CI script that builds the image of a commit, tests it with Compose, then publishes an archive with its provenance. The build cache shared between runs and the promotion of the same image from one registry to another are measured in the reference page BuildKit cache in CI and image promotion between registries, which does not cover promotion between environments: the lesson Promote the same artifact between two environments (about 55 min) covers it, by transferring an archive to a second host and deploying with --no-build --pull never so that no environment rebuilds the image.

The lesson Check what an image contains, and who signed it (about 50 min) scans an image with Trivy, writes a gate that refuses a named CVE, then signs an archive with a local authority and verifies the chain, the identity and the signature; Cosign and DOCKER_CONTENT_TRUST are only placed there.

The lesson Prepare operations, and recognize the limits of a single host (about 40 min) measures an SLO, ties alerts to the signals Docker exposes, times a restore, then checks that the service comes back after the host restarts, and what a single host cannot guarantee. The final exam "take over an unknown service" (about 3 h) closes the course: an application to deliver, harden, break and restore end to end, scored on its final state. The module adds up to about 6 h 05.

Quick reference

Do you want an "immediate answer" page? This section is made for that.

Concepts (image/container/layers): what to remember
  • Image: immutable artifact (like a built binary or a package).
  • Container: isolated process (like a systemd service) + ephemeral FS.
  • Layer: diff (like a Git commit), stacked and cacheable.
  • Volume: persistent storage (like a local PVC, but on the Docker side).
  • Bridge network: isolated NAT network (like a Docker "default" VRF).

→ Concepts guide

CLI: the commands that really matter
  • "I run": docker run …
  • "I look": docker ps, docker images
  • "I understand": docker logs, docker inspect
  • "I get in": docker exec -it … sh
  • "I clean up": docker rm, docker rmi, docker system prune

→ CLI guide

Volumes: quick choice
  • Bind mount: dev / local code / quick debugging.
  • Named volume: prod / application data / DB.
  • tmpfs: temporary secret / performance / nothing on disk.

→ Volumes guide

Networks: quick choice
  • bridge: standard case (multi-container app on 1 host).
  • host: maximum performance, minimal network isolation.
  • overlay: multi-host (Swarm) / distributed network.

→ Networks guide

Troubleshooting: "what do I do when it doesn't work"
  • If it crashes: exit code + logs + inspect (fixed order).
  • If it does not answer: published ports + IP/route + DNS + healthcheck.
  • If it does not pull: registry auth + DNS + proxy + certs.

→ Troubleshooting guide

Security: simple rules
  • Avoid root (rootless if possible).
  • Drop unneeded capabilities, read-only FS if possible.
  • Scan images, update regularly.
  • Secrets outside the image and outside exposed variables.

→ Security guide → Secrets guide (in French)

Landmarks: standards and ecosystem

The timeline reads from top to bottom, from 2010 to 2024: it places the dates that explain why the ecosystem no longer depends on a single tool, with the deprecation of dockershim by Kubernetes in 2020 (Kubernetes 1.20) highlighted, followed by its removal in 2022 (Kubernetes 1.24).

Landmarks in the evolution of the Docker ecosystem: dotCloud in 2010, Docker open source in 2013, explosive adoption in 2014, creation of the OCI in 2015, containerd at the CNCF in 2017, deprecation of dockershim by Kubernetes in 2020, BuildKit by default in Docker 23.0 in 2023, OCI standard in 2024.2010 · dotCloudSolomon Hykes2013 · Docker open sourceBuild once, run anywhere2014 · Explosive adoptionGCP, AWS, Azure2015 · OCI foundedOpen Container Initiative2017 · containerd → CNCFKubernetes adopts it2020 · Kubernetes deprecates dockershim→ containerd2023 · Docker 23.0BuildKit by default2024 · Millions of usersOCI standard
Source · SVG
Esc to close, + and − to zoom, scroll to move around. 100 %

FAQ: frequently asked questions

Is this project useful to you?

The guides, courses, quizzes and labs stay free. If you use them regularly, you can contribute to their upkeep and development.

Become a supporting member (new tab) One-time support (new tab) Learn more

Follow the project on LinkedIn