Skip to content
BiliMind
Roadmap

How to learn Docker

This path assumes you can use a terminal and edit text files. It takes you from running your first container to debugging multi-container applications with Compose, volumes and networks. The core is images, layers and the build cache — get those right and most Docker problems become visible.

Hours

60-80 hours

Calendar

about 12-16 weeks at 5 hours a week

Stages

6

Start from

You need basic terminal comfort and the ability to edit a text file. You do not need to know Kubernetes, cloud platforms, or any programming language to start, though being able to read a Dockerfile helps after the first week.

Why the usual order fails

Most Docker tutorials start with running an image someone else built. You pull nginx, you map a port, you see a welcome page, and you have learned almost nothing about how Docker works. The problem compounds when you write your first Dockerfile: the build cache seems arbitrary, image sizes balloon, and you copy fixes from Stack Overflow without knowing why they work. The common order teaches you to operate Docker before you understand what an image actually is.

This path inverts that order. In week one you build an image from a three-line Dockerfile, change one line, rebuild, and watch the layer cache in action. You learn to read `docker history` and `docker inspect` before you ever touch Compose. By the time you reach orchestration, you already know why an image rebuilds in two seconds or two minutes, and you can predict the difference before you run the command.

The path, in the order it has to be walked.

Each stage assumes the one above it and nothing below it. The check at the foot of each is the point — you are meant to fail it, go back, and try again before moving on.

  1. Images and layers

    weeks 1-2, 8-12 hours

    You build your first images and learn to see them as ordered stacks of read-only layers. This stage sits first because every later topic — caching, size, security, multi-stage builds — is a consequence of how layers work.

    • Dockerfile instructions: FROM, RUN, COPY, ADD, CMD, ENTRYPOINT, ENV, WORKDIR
    • Layer creation rules: which instructions create a layer and which do not
    • Reading `docker history` and `docker inspect` output
    • Image tags and the `latest` convention
    • Registry basics: Docker Hub, pulling, pushing
    • Image size measurement with `docker images`

    You can now: Build the same application twice with different instruction ordering and explain, from `docker history`, why one image is 200MB larger.

  2. The build cache

    weeks 3-4, 10-14 hours

    You learn exactly when the cache is invalidated and how to structure a Dockerfile so that slow steps stay cached. This stage follows images and layers because the cache is the practical payoff of understanding them.

    • Cache invalidation rules: instruction order, file changes, base image changes
    • The difference between COPY and ADD for caching
    • Using .dockerignore to protect the cache
    • BuildKit and `DOCKER_BUILDKIT=1`
    • Cache-busting techniques: build args, versioned dependencies
    • Reading build output to see which steps used cache

    You can now: Take a Dockerfile that rebuilds a 400MB dependency layer on every source change and restructure it so the dependency layer stays cached.

  3. Running containers

    weeks 5-6, 10-14 hours

    You move from building to running: process lifecycle, logs, signals, resource limits, and restart policies. This stage comes after the build cache because running containers is mostly about managing what the image already contains.

    • Container lifecycle: create, start, stop, kill, rm
    • Foreground vs detached mode, `docker logs`, `docker attach`
    • PID 1 and signal handling, `docker stop` vs `docker kill`
    • Resource limits: --memory, --cpus, --pids-limit
    • Restart policies: no, on-failure, always, unless-stopped
    • Port publishing and the difference between EXPOSE and -p

    You can now: Run a container that handles SIGTERM gracefully, confirm it with `docker stop`, then write a second container that ignores SIGTERM and observe the 10-second default kill delay.

  4. Volumes and networks

    weeks 7-8, 10-14 hours

    You learn where container data lives and how containers talk to each other. This stage follows running containers because volumes and networks only matter once you have stateful or multi-container applications.

    • Named volumes vs bind mounts vs tmpfs
    • Volume lifecycle: create, inspect, prune, backup and restore
    • The copy-up behaviour for empty named volumes
    • Bridge networks and container DNS resolution
    • User-defined networks vs the default bridge
    • Network drivers: bridge, host, none, overlay (concept only)

    You can now: Run two containers on a user-defined network that communicate by container name, then move one to the default bridge and show that DNS resolution stops working.

  5. Docker Compose

    weeks 9-10, 10-14 hours

    You define multi-container applications in a single file. This stage sits after volumes and networks because a Compose file is mostly a declarative wrapper around the run, volume and network commands you already know.

    • Compose file structure: services, networks, volumes
    • The difference between `docker compose` and `docker-compose`
    • Build context and image reuse in Compose
    • Environment variables and .env files
    • Depends_on and healthchecks for startup ordering
    • Compose lifecycle: up, down, restart, logs, exec

    You can now: Define a three-service application (web, database, cache) in a Compose file, bring it up with one command, and show that the web service can resolve the database by service name.

  6. Multi-stage builds and image size

    weeks 11-12, 10-14 hours

    You reduce image size and attack surface by separating build dependencies from runtime dependencies. This stage comes last because it requires fluency with layers, the cache and running containers to be meaningful.

    • Multi-stage build syntax: multiple FROM instructions, named stages, COPY --from
    • Choosing minimal base images: alpine, distroless, scratch
    • Non-root users and USER instruction
    • Layer squashing and experimental features
    • Image scanning with `docker scout` or third-party tools
    • Reproducible builds: pinning base image digests

    You can now: Take a single-stage image with a full toolchain and reduce it by 80% using a multi-stage build, then run the result as a non-root user.

The hours are fixed. The calendar is yours.

The same path at three speeds, and what actually goes wrong at each.

3 hours a week

You will finish in roughly 20-27 weeks. The build cache stage will feel abstract because you are not rebuilding images often enough for the patterns to stick. Expect to re-read earlier material when you return after a gap.

8 hours a week

You will finish in 8-10 weeks. This is the sustainable pace for retention. You can rebuild the same image multiple times in a single session, which is what makes layer and cache behaviour actually memorable.

20 hours a week

You will finish in 3-4 weeks, but Compose and multi-stage builds will blur together. The risk is knowing the commands without being able to explain why a build is slow or why a container will not stop cleanly.

What goes wrong

Four ways people lose a year on this.

Each of these is appealing for a real reason, which is why they are common. What they cost is the part nobody mentions.

  • Learning Kubernetes before understanding images

    People jump to orchestration because job descriptions mention it. Kubernetes adds a scheduler, a network model and a storage abstraction on top of Docker concepts. If you cannot explain why an image rebuilds from cache, Kubernetes will not teach you that. You will spend weeks configuring YAML while basic image problems remain invisible.

  • Using `latest` tags in Dockerfiles and Compose files

    It is appealing because it always works and you never have to think about versions. Then a base image updates, your build cache invalidates silently, and you cannot reproduce last month's build. Pin base images by digest or at minimum a specific version tag. The ten seconds you save now costs hours later.

  • Putting `apt-get upgrade` or `yum update` in every build

    It feels responsible — you are keeping the image patched. But it makes builds non-reproducible and invalidates the cache unpredictably. A Dockerfile that built yesterday may fail today because a package changed upstream. Update base images deliberately by bumping the pinned version, not by running upgrade inside the build.

  • Treating containers like virtual machines

    People SSH into containers, install packages manually, and expect the changes to persist. They do not. A container is a process with a filesystem, not a long-lived server. When you rebuild the image or restart the container, manual changes disappear. The habit of fixing things inside a running container delays the moment you learn to change the Dockerfile.

How to know it worked.

Not a syllabus you tick off — six things to attempt. If one of them is still hard, the stage it belongs to is the one to go back to.

  1. Build an image, change one line in the Dockerfile, rebuild, and explain which layers reused cache.
  2. Run `docker history` on an image and identify which instruction created each layer.
  3. Write a .dockerignore that prevents a 500MB local file from invalidating the build cache.
  4. Run a container that ignores SIGTERM and observe the 10-second delay before SIGKILL.
  5. Create two containers on a user-defined network and show they resolve each other by name.
  6. Convert a single-stage image to a multi-stage build and reduce its size by at least 60%.
Questions

Questions about learning Docker.

The five we hear most. The intro film answers most of them in a minute and a half.

how long does it take to learn docker

Genuine working competence takes 60-80 hours of deliberate practice. That means building images, breaking the cache on purpose, and debugging containers that will not stop. You can run your first container in 20 minutes, but that is not the same as knowing Docker.

do I need to learn kubernetes to use docker

No. Docker and Kubernetes solve different problems. Docker packages and runs a single container or a small set of them on one machine. Kubernetes schedules containers across many machines. Learn Docker first; Kubernetes concepts make far more sense once you understand images, volumes and networks.

is docker still relevant in 2025

Yes. Most production systems run containers, and the image format Docker popularised is an industry standard. Even if you use Podman or containerd directly, the concepts — layers, build cache, registries, OCI images — are the same. Docker the company may change, but the technology is not going away.

what is the difference between a container and an image

An image is a read-only stack of layers — a filesystem snapshot plus metadata about how to run it. A container is a running instance of that image with a writable layer on top. Stopping a container discards that writable layer; the image underneath is unchanged. This is why manual changes inside a container do not persist.

why is my docker image so large

Because every RUN, COPY and ADD instruction adds a layer, and layers are never removed. Package manager caches, build tools and source code all end up in the final image unless you delete them in the same instruction or use a multi-stage build. Check `docker history` to see which layers contribute the most size.

A path is not a course.

This is the shape of Docker, not the teaching of it. Hand the same path to BiliMind and it writes the lessons onto it — in the form each one calls for, with practice that gets marked and a schedule that bends when your week does. Mapping a course is free and unlimited.

This roadmap was drafted on 18 September 2026 by the same engine that builds BiliMind courses, and reviewed before publishing. Hours are honest estimates for working competence, not for a demo — treat them as a starting point and adjust them against your own first fortnight.

The intro · 1:25