Docker
Docker
Install Docker, run containers, and keep data and disk space under control.
- 20 lessons
- 5h 38m estimated time
- 4 hands-on labs
- 2 animated diagrams
- 20 quizzes
13 beginner, 7 intermediate. Start at the top or pick a chapter below.
0 of 20 done
Saved in this browser as you finish lessons.
First containers
Install Docker, run a container and describe an app with Compose.
01 Up next Install Docker on Ubuntu Docker Engine is installed on Ubuntu by adding Docker's official apt repository and installing the docker-ce packages. 22 min Beginner Lab 02 Up next Run your first Docker container (docker run) A container is a running instance of an image; docker run pulls the image if needed and starts the container. 15 min Beginner Lab 03 Up next Docker Compose basics: run web and database with compose.yaml Docker Compose runs several containers together from one YAML file that describes the services, ports and volumes. 18 min Beginner Lab 07 Up next Docker image vs container vs registry, and how tags work An image is a read-only template, a container is a running instance of an image, and a registry is a server that stores and shares images. 22 min Beginner Diagram 10 Up next Docker Compose environment variables: environment, env_file, .env Compose passes settings to a container through the environment key or an env_file, and fills ${VAR} placeholders in compose.yaml from the shell or a project .env file. 22 min Beginner 12 Up next Run commands inside a Docker container (docker exec) docker exec runs a command inside an already running container, which is the normal way to open a shell and inspect it. 14 min Beginner
Build images
Write a Dockerfile, keep images small and roll out new versions.
05 Up next Write your first Dockerfile and build an image with docker build A Dockerfile is a text file of instructions that tells Docker how to build an image for your app. 22 min Beginner 13 Up next Multi-stage Docker builds for smaller images A multi-stage build uses several FROM lines in one Dockerfile so tools needed to build the app stay out of the final image. 18 min Intermediate 15 Up next Update a Docker container to a new image Updating a Compose service means pulling the new image and running docker compose up -d, which recreates only the containers whose image changed. 14 min Beginner
Data and disk
Keep data across restarts and stop Docker from filling the disk.
04 Up next Docker volumes and persistent data: named volume vs bind mount A Docker volume is storage managed by Docker that outlives any container that uses it. 20 min Beginner Lab 08 Up next Free disk space with docker system prune (safely) Docker prune commands remove unused objects such as stopped containers, dangling images and build cache to free disk space. 15 min Beginner 19 Up next Bind mounts vs volumes: permissions and ownership A bind mount exposes a host folder with its own numeric owners, while a named volume is managed by Docker and copies image content in when it starts empty. 14 min Intermediate 20 Up next Docker logging drivers and log rotation explained A Docker logging driver decides where a container's stdout and stderr go, and json-file, the default, keeps them on disk without rotation unless you set limits. 12 min Intermediate
Networking
How containers find each other and what a published port exposes.
06 Up next Docker networks explained: connect containers by name A Docker network is a virtual network that lets containers on the same host reach each other, and the outside world, by rules Docker sets up. 20 min Beginner Diagram 14 Up next Publish Docker container ports safely Publishing a port with -p exposes it on every host address unless you bind it to 127.0.0.1, and Docker's own firewall rules can bypass UFW. 14 min Intermediate 16 Up next Docker bridge vs host networking: which to use A bridge network gives each container its own network namespace behind NAT, while host mode makes the container share the host's network stack directly. 12 min Intermediate 17 Up next What 0.0.0.0 means when publishing Docker ports In a -p mapping, 0.0.0.0 means the host port listens on every IPv4 interface, while 127.0.0.1 limits it to the server itself. 12 min Intermediate 18 Up next DNS inside Docker: how containers find each other On user-defined networks Docker runs an embedded DNS server at 127.0.0.11 that resolves container names, service names and aliases to container IP addresses. 12 min Intermediate
Keep it running
Health checks and restart rules that bring a container back.
09 Up next Docker healthcheck: add HEALTHCHECK and read container health A Docker healthcheck is a command Docker runs inside a container on a schedule to decide whether the app is healthy, which is a stronger claim than running. 20 min Beginner 11 Up next Docker restart policy: always vs unless-stopped vs on-failure A restart policy tells Docker whether to start a container again after it exits or after the host reboots, and unless-stopped is the usual choice for services. 20 min Beginner