Recall first: read each stage's one-line summary and try to remember its commands. Then open the stage to check yourself.
15 stages32 commands
docker run hello-worldPull and run Docker's introductory container image
docker imagesList locally available images
Watch for A container is not a VM; isolation does not mean it has a separate kernel.
Open the lesson: Containers: what they are and why they won →docker run -d --name cow alpine:3.22 sleep 300Start a small container process to inspect from the host and container
docker inspect -f '{{.State.Pid}}' cowRead the container process ID as seen by the host
Watch for The container's PID 1 is not necessarily PID 1 on the host.
Open the lesson: Under the hood: namespaces, cgroups and layered filesystems →docker versionCheck that the Docker client can reach a Docker Engine
sudo install -m 0755 -d /etc/apt/keyringsCreate the directory used for the repository signing key
docker group grants root-equivalent access to the host.Watch for Don't add an account to the docker group as if it were an unprivileged permission.
docker run -d --name web -p 8080:80 nginx:1.30-alpineStart nginx and publish its container port 80 on host port 8080
curl -sI localhost:8080 | head -2Check the HTTP response from the published port
docker ps shows running containers; docker ps -a includes stopped containers.Watch for A stopped container still exists; remove it separately when you no longer need it.
Open the lesson: Docker basics: images, containers, ports, logs and exec →docker run --rm -v "$PWD":/work -w /work python:3.13-slim python total.pyRun a Python script from a temporary runtime image against the current folder
docker run --rm -i ghcr.io/jqlang/jq:1.8.1 '[.orders[].price] | add'Run jq from an image and pass input on standard input
--rm removes a one-shot container after it exits.-w selects the working directory inside the container.Watch for Bind-mount only the files the tool needs; the container can access mounted host data.
Open the lesson: Other people's images: databases, tools and runtimes →docker volume create pgdataCreate a named volume for database files
docker exec db psql -h 127.0.0.1 -U postgres -c "select t from notes"Verify that data remains available after replacing the database container
Watch for Recreating a container does not preserve data kept only in its writable layer.
Open the lesson: Keeping data: volumes, bind mounts and backups →docker build -t price-api:single -f Dockerfile.single .Build the image from the selected Dockerfile and tag it
docker images price-apiCompare the locally built image sizes
Watch for A broad build context can send secrets and unrelated files to the builder; use .dockerignore.
docker tag price-api:multi localhost:5000/price-api:1.0.0Add a registry-qualified tag to the built image
docker push localhost:5000/price-api:1.0.0Push the tagged image to the local registry
Watch for A tag alone does not prove which image content a later pull will return.
Open the lesson: Registries: Docker Hub, GHCR, ECR and tags you can trust →docker run -d --name flaky --restart on-failure:3 alpine:3.22 sh -c 'echo starting; exit 1'Demonstrate a bounded restart policy for a failing process
docker compose up -dStart the services described in the Compose file
Watch for Restart loops can hide the original failure; inspect logs and exit state before raising retries.
Open the lesson: Running containers well: restart policies, limits, config and Compose →docker network lsList Docker networks
docker network inspect bridge --format '{{range .IPAM.Config}}{{.Subnet}} gw {{.Gateway}}{{end}}'Inspect the default bridge network's subnet and gateway
Watch for EXPOSE documents a port; -p actually publishes it from the host.
docker run --rm alpine:3.22 idCheck the default user inside the image
docker run --rm --user 1000:1000 alpine:3.22 sh -c 'id; touch /etc/x'Test a container process running as a non-root UID/GID
Watch for A secret passed through an environment variable can be visible to process inspection and diagnostics.
Open the lesson: Container security: scanning, non-root, runtime limits and secrets →docker image ls --filter reference='price-api*' --format '{{.Repository}}:{{.Tag}} {{.Size}}'List matching images with their repository, tag and size
docker system dfMeasure Docker disk use before cleanup
--format makes it suitable for scripts.Watch for docker system prune can remove resources you meant to keep; review its scope before confirming.
docker compose watchStart Compose's file-watch workflow for development
curl -s localhost:3000Check the app after a watched source change
Watch for Mounting over a container path hides the files that were already at that path in the image.
Open the lesson: Developing with Docker: hot reload, debugging, tests and CI →docker swarm init --advertise-addr 127.0.0.1Initialize a local Swarm manager for the lesson's example
docker service lsList services running in the Swarm
Watch for docker run starts a container; docker service create asks Swarm to maintain a service.
docker build --target test .Build only the test stage, which fails on a failing test
docker build --target runtime -t shop-api:ci .Build the image you ship
trivy image --severity HIGH,CRITICAL --ignore-unfixed --exit-code 1 shop-api:ciFail on fixable HIGH or CRITICAL vulnerabilities
docker inspect --format '{{index .RepoDigests 0}}' localhost:5000/shop-api:testRead the digest of a pushed image
Watch for Registry names must be lowercase, so lowercase GITHUB_REPOSITORY before using it in an image name.
Open the lesson: Back to your pipeline: test, scan, push and deploy the image →