Docker fundamentals
Images, containers, networks and volumes.
Level 101 · 18 lessons · 15 practice labs
Lessons
Getting started
- What Docker is: engine, image, container: You will understand Docker's engine, image and container, and why an application is run in its own package.
- Pulling images and running containers with Docker: You will use Docker to download a ready-made image, start a container from it and check that it is running.
- The Docker container lifecycle: You will follow the steps of a Docker container being created, running, stopped and removed, and watch its state.
- Docker logs, inspect and exec: You will read a Docker container's logs, inspect its details and step inside it to look for problems.
- Short task: run a web server container and inspect its logs and settings
For your application
- Publishing ports with Docker: You will publish a Docker container's port to the host machine and understand from which addresses it then becomes reachable.
- Docker environment variables: You will pass settings to a Docker container with environment variables and understand why secret values like passwords need careful handling.
- Docker bind mounts: You will attach a folder from the host machine inside a Docker container and see the access risk that this brings.
- Docker volumes and their backups: You will set up Docker volumes that keep data even when a container is deleted, and learn to back them up.
- Docker networks and service discovery: You will connect Docker containers to a shared network so they find each other by name, and close access that is not needed.
- Short task: run an app with its database on one network with persistent data
Building images
- Dockerfile basics: You will read how the lines of a Dockerfile build an image step by step and write a simple one.
- Building and tagging with Docker: You will build an image from a Dockerfile and name it with a version tag so images can be told apart.
- Docker registries, save and load: You will learn how Docker images are stored in a registry, and how to save an image to a file and load it on another machine.
- Docker resource limits and restart policies: You will limit a Docker container's memory and processor use and set the rule for restarting it after a crash.
- Docker clean-up: You will safely find and clear unused Docker containers, images and volumes to stop the disk from filling up.
- Short task: build and tag your own image and move it to another machine
Wrap-up
- Capstone: containerise an application with Docker: You turn a fictional company's small application into an image with a Dockerfile, run it with its port and settings, and verify it works.
Practice labs
- A container that exits at once: Find why the container stops right after starting from its logs and exit code, run it again with the right command and show with docker ps that it stays up.
- A container’s hidden settings: Pull the running container’s environment variables, mounts, IP address and restart policy into one report using docker inspect format templates.
- The container nobody knows about: Inspect an undocumented container on the server for its image, process, ports, mounts and environment, write an equivalent docker run command and show the new container does the same job.
- A site that won’t open: Fix the published port that points to the wrong container port on Cinnamon Café’s web container and show the site opens from the host with curl.
- An environment file read wrong: Fix the environment file whose quoting and spacing mistakes make the app read the wrong database address, and verify the values inside the container with env.
- Admin panel for local access only: Keep the app’s public port open to everyone while making the admin panel’s port reachable only from the host itself, and prove it with an attempt from the lab’s second machine.
- Data that survives removal: Move the notes app’s data to a named volume, remove and recreate the container and show the records are still there.
- Volume backup and restore: Back up the database volume to an archive with a helper container, restore it into a new volume and prove the checksums on both sides match.
- A bind mount that hides the config: Fix the app that won’t start because an empty host folder masks the image’s configuration files, mount only the files that are needed and show the app comes up.
- A first Dockerfile that won’t build: Fix the Dockerfile that fails on copy paths and working directory, build the image with a version tag and show the container runs.
- Version tags and a local registry: Push Caravan Travel’s app image to the lab registry with a version tag and latest, delete the local copies and show that pulling the specific version brings back the right image.
- An image that runs as root: Rework the Dockerfile that runs the app as root so it runs as an unprivileged user, fix file ownership and prove with id output that the app can still write where it needs to.
- Disk is full: a safe clean-up: Clean up stopped containers and dangling images without touching volumes in use, and report the space gained with docker system df before and after.
- Rein in a greedy container: Put memory and CPU limits on the report container that eats all memory and CPU, and show with docker stats that the limits apply.
- The restart policy trap: Fix the policies of one container stuck in an endless restart loop and another that never comes back after a daemon restart, and prove both behave correctly by restarting the Docker service.
About this course
Images, containers, networks and volumes.
What you will learn
- Getting started
- For your application
- Building images
- Wrap-up
Prerequisites
No prior knowledge is needed; the course starts from zero.
Lab environment
Lessons run in your own Kali Linux terminal in the browser, connected to a private lab network. Nothing to install.
Frequently asked questions
- Is this course right for my level?
- The course is at beginner level; every term is explained where it first appears.
- Is there anything to install?
- No. Every lesson runs in your own lab environment that opens in the browser.
- How do lessons work?
- Each lesson has 8 to 10 steps and a short quiz. Early steps show the command to type, later steps give less help; if two attempts fail, the solution opens.
- Can I try it for free?
- Yes. The first three lessons of every course are free.