Containers: Docker and compose
Image and container, ports, environment and restart, your own Dockerfile, volumes, container networking and a compose stack, memory limits and the user inside a container.
11 stages5 labs~6 hours medium
The track has not been started. The first stage is «Image, container and process», ~30 min.
Module 1
A container from the inside
How an image differs from a container, why a container exited at once, how to publish a port, pass the environment and set a restart policy.
3 stages · ~2 hours
-
Stage 1 of 11
1 · Image, container and processImage, container and process
6 steps · ~30 min 6 steps · ~30 min- The web server started and vanished exercises 0 of 1 on a machine 5 min
- 2 Image and container on a machine 6 min
- 3 A container lives while its process runs on a machine 8 min
- 4 Inside the container on a machine 5 min
- 5 Experiment: a container from alpine on a machine 4 min
- 6 Summary summary 2 min
-
Stage 2 of 11
2 · Ports, variables and restartPorts, variables and restart
8 steps · 2 labs · ~1 hour 8 steps · 2 labs · ~1 hour- The container runs, the site is silent exercises 0 of 1 on a machine 5 min
- 2 Container port and server port on a machine 7 min
- 3 Environment variables on a machine 6 min
- 4 Restart policy theory 6 min
- 5 Experiment: a queue that comes back by itself on a machine 4 min
- 6 Container won't start lab 20 min
- 7 A service from a container lab 20 min
- 8 Summary summary 2 min
-
3 · Module test 10 questions · pass mark 70%
Module 2
Images and data
How to build an image from a Dockerfile, where the layer cache works, where container data lives and how to keep it in a volume or a host directory.
3 stages · ~2 hours
-
Stage 4 of 11
4 · Dockerfile: your own imageDockerfile: your own image
7 steps · 1 lab · ~50 min 7 steps · 1 lab · ~50 min- The edit did not arrive exercises 0 of 1 on a machine 5 min
- 2 An image is built from a Dockerfile on a machine 7 min
- 3 Layers and tags theory 5 min
- 4 The build cache on a machine 7 min
- 5 Your own storefront on nginx on a machine 4 min
- 6 A new image version lab 20 min
- 7 Summary summary 2 min
-
Stage 5 of 11
5 · Volumes: data outlives the containerVolumes: data outlives the container
7 steps · 1 lab · ~50 min 7 steps · 1 lab · ~50 min- The notes are gone exercises 0 of 1 on a machine 5 min
- 2 The container layer theory 5 min
- 3 A named volume on a machine 7 min
- 4 A host directory on a machine 6 min
- 5 A report through nginx on a machine 5 min
- 6 Data after re-creation lab 20 min
- 7 Summary summary 2 min
-
6 · Module test 10 questions · pass mark 70%
Module 3
Several containers
How containers find each other by name, how to describe a stack in one file and diagnose its failure with compose ps and logs.
3 stages · ~1 hour
-
Stage 7 of 11
7 · Container networking: names and portsContainer networking: names and ports
6 steps · ~30 min 6 steps · ~30 min- The application cannot find its database exercises 0 of 1 on a machine 6 min
- 2 The default network on a machine 7 min
- 3 A network of your own: names work on a machine 6 min
- 4 The neighbour's port theory 5 min
- 5 Experiment: the reports service on a machine 4 min
- 6 Summary summary 2 min
-
Stage 8 of 11
8 · docker compose: a stack in one filedocker compose: a stack in one file
7 steps · ~30 min 7 steps · ~30 min- The site answers 502 exercises 0 of 1 on a machine 5 min
- 2 The stack file on a machine 6 min
- 3 Editing and re-creating on a machine 5 min
- 4 Volumes and down theory 4 min
- 5 Health checks theory 4 min
- 6 Experiment: the notes stack on a machine 4 min
- 7 Summary summary 2 min
-
9 · Module test 10 questions · pass mark 70%
Module 4
Container resources and security
How to limit the memory and CPU of a container, what exit code 137 and OOMKilled mean and how to run the process as non-root.
2 stages · ~1 hour
-
Stage 10 of 11
10 · Limits, OOMKilled and the user in a containerLimits, OOMKilled and the user in a container
9 steps · 1 lab · ~55 min 9 steps · 1 lab · ~55 min- The report broke off exercises 0 of 1 on a machine 4 min
- 2 The memory limit and the OOM killer theory 6 min
- 3 How much a container takes on a machine 4 min
- 4 The CPU quota theory 4 min
- 5 Who runs in the container on a machine 4 min
-
6
The
--useroption theory 3 min - 7 The report to the end on a machine 3 min
- 8 A container restarts under load lab 25 min
- 9 Summary summary 2 min
-
11 · Module test 9 questions · pass mark 70%
-
-
Final test 18 questions · pass mark 80%