Skip to main content
DevOpsLabTH.dev

Docker

Package an app once, run it anywhere. Build images that don't double in size every Friday.

beginner22 labs
Recommended first

You can still start this course now. Earlier courses give you the mental model the labs here assume.

By the end you'll be able to
  • Build images that don't ship your .env file
  • Debug a running container without rebuilding
  • Compose multi-service stacks locally
  • Read a Dockerfile and predict what it'll produce

Labs

  1. 01
    Container vs virtual machine
    Form a mental model of how a container differs from a virtual machine so the rest of the Docker labs make sense.
    10 min
    Start
  2. 02
    Image vs container
    Pull a small image, start two containers from it, and see one image produce many running instances.
    12 min
    Start
  3. 03
    Image layers and copy-on-write
    Look inside an image to see the layer stack, then write a file in a running container to see copy-on-write at work.
    12 min
    Start
  4. 04
    Dockerfile in one minute
    Look at the three instructions every Dockerfile needs and build a one-line image from them.
    10 min
    Start
  5. 05
    docker run and the flags that matter
    Run containers in foreground, detached, and interactive mode, and learn the half-dozen flags you reach for every day.
    15 min
    Start
  6. 06
    docker ps and how to filter it
    Read the docker ps table, list stopped containers with -a, and trim the output with --format and --filter.
    10 min
    Start
  7. 07
    docker exec into a running container
    Run a command inside a container that is already running, and open an interactive shell to look around.
    12 min
    Start
  8. 08
    Stop, remove, and prune containers
    Stop a running container, remove a stopped one, and reclaim space with docker container prune.
    10 min
    Start
  9. 09
    FROM, RUN, CMD in a real Dockerfile
    Build an image that installs a package at build time and runs a command at start time.
    15 min
    Start
  10. 10
    COPY, ADD, and .dockerignore
    Copy files into an image, see what ADD does on top, and trim the build context with .dockerignore.
    15 min
    Start
  11. 11
    Multi-stage builds
    Compile in a fat builder stage, then copy only the binary into a tiny runtime stage.
    18 min
    Start
  12. 12
    Tagging and versioning images
    Tag an image with a version, a moving alias, and a registry path so later pushes go to the right place.
    12 min
    Start
  13. 13
    Image cleanup and layer inspection
    See how dangling images appear, look inside an image with docker history, and reclaim disk with docker image prune.
    12 min
    Start
  14. 14
    Publishing container ports
    Map a container port to a host port with -p, see the difference vs --expose, and pick a host port at random.
    12 min
    Start
  15. 15
    Custom bridge networks and DNS
    Create a user-defined bridge network, attach two containers, and let them talk by container name.
    14 min
    Start
  16. 16
    Named volumes for persistent data
    Create a named volume, write data into it from one container, and read it back from a fresh one.
    12 min
    Start
  17. 17
    Bind mounts and host paths
    Mount a host directory into a container, see writes show up on both sides, and learn when to pick a bind mount over a named volume.
    12 min
    Start
  18. 18
    Compose, a one-file stack
    Write a compose.yaml with one service, run docker compose up, and see one file describe a whole stack.
    15 min
    Start
  19. 19
    depends_on and healthchecks
    Order two services with depends_on, gate startup with a healthcheck, and see the difference between started and healthy.
    18 min
    Start
  20. 20
    Compose environment variables and .env
    Pass environment variables into a service from inline, from a list, and from a .env file.
    15 min
    Start
  21. 21
    Diagnose a container that will not stay up
    A container exits the moment it starts. Read its state and its logs to find why, then start it correctly so it stays running and answers.
    14 min
    Start
  22. 22
    Capstone, build an image and serve it on a network
    An open-ended problem with no prescribed commands. Build your own image that serves a known string, run it under a name on a user-defined network, and prove a second container reaches it by that name.
    25 min
    Start