DCubes
Docker module

Foundations · Module 02

Docker and Compose

A beginner path from “what is a container?” to images, volumes, ports, and a Compose data stack. Practice only on your machine.

Beginner14 lessons~7 hours plus a demo

Data tools ship as containers: Postgres, Spark, Airflow, notebooks. A Compose file is how a team says “this stack, these ports, this volume.” This module teaches that language after Linux — still on your machine, still with you typing every command.

You will install Docker, run images, persist files, publish ports, then describe a small stack in Compose. The site never runs containers for you.

Start here

Finish Linux Getting Started first so you have a terminal and~/dcubes. Then do this module’s Getting Started even if Docker Desktop is already installed — we create~/dcubes/docker-lab and check docker compose.

  1. On-ramp

    Ready

    Your Docker practice environment

    Install Docker and Compose on Windows, macOS, or Linux. This site never runs containers — you will.

    45 min

  2. Lesson 1

    Ready

    Why Docker for Data Engineering

    Where containers show up in data work, and which Docker skills you will use every week.

    20 min

  3. Lesson 2

    Ready

    Images, containers, and Compose

    The mental model — image, container, Dockerfile, and Compose file — before you type docker run.

    25 min

  4. Lesson 3

    Ready

    Run a container

    docker run, flags, Alpine, and the difference between a command that exits and a command that stays up.

    30 min

  5. Lesson 4

    Ready

    Container lifecycle

    Name a container, read logs, stop it, start it, and remove it without pruning the world.

    25 min

  6. Lesson 5

    Ready

    Look inside

    docker exec for a shell in a running container, and inspect for the JSON facts.

    25 min

  7. Lesson 6

    Ready

    Images and tags

    Docker Hub, docker pull, tags versus latest, and how to see what you already downloaded.

    25 min

  8. Lesson 7

    Ready

    Write a Dockerfile

    FROM, COPY, RUN, CMD, docker build, and why you do not bake secrets into an image.

    35 min

  9. Lesson 8

    Ready

    Persist data

    Bind mounts versus named volumes, and why warehouse files must live outside the container layer.

    30 min

  10. Lesson 9

    Ready

    Publish ports

    Container ports versus host ports, -p, and why Postgres is unreachable until you publish it.

    25 min

  11. Lesson 10

    Ready

    Environment in containers

    -e, --env-file, and why database passwords stay out of Dockerfiles and git.

    25 min

  12. Lesson 11

    Ready

    Compose up

    A compose.yaml, services, docker compose up and down — one file instead of a pile of flags.

    35 min

  13. Lesson 12

    Ready

    Compose a data stack

    Postgres plus a one-shot job, healthchecks, depends_on, and a named volume for the data directory.

    40 min

  14. Lesson 13

    Ready

    Debug and cleanup

    Read Compose logs, exec into a service, check Docker disk use, and prune without deleting your warehouse volume by accident.

    25 min

Demo