liveBook · Manning

Docker

As explained in Data Pipelines with Apache Airflow, Second Edition

Docker is a platform for building, distributing, and running applications in containers.

Docker provides isolated environments for reproducible applications. A container can package Python libraries together with dependencies such as database drivers or compilers, without requiring a separate guest operating system. section 2.3.2 section 11.2.1

For Airflow, Docker becomes especially useful as configurations grow and pipelines depend on multiple services. Docker Compose defines those services and their configuration in YAML, including databases, workers, schedulers, and related components. section 2.3.2 section 11.0

A Docker-based Airflow setup typically involves:

  • Installing Docker Engine, commonly through Docker Desktop. section 2.3.2
  • Defining the base services in a Docker Compose YAML file and extending them with chapter- or project-specific overrides. section 2.3.2
  • Starting the services together so Airflow can initialize its database, create its first user, and run its components. section 2.3.2
  • Running selected Airflow tasks inside Docker containers when operator diversity makes deployment and maintenance difficult. section 11.0 section 11.4

Start a local Airflow environment

From the project directory, run `docker compose up`. After the services finish configuring, run `docker ps` to inspect the Airflow worker, API server, DAG processor, scheduler, triggerer, PostgreSQL, and Redis containers.

Listing 2.10 Running docker compose up to get Airflow ready to run
@user $ cd chapter02

@user $ docker compose up

Shows the command sequence for starting the Compose-managed Airflow environment. section 2.3.2

Listing 2.11 List of the Airflow services running
@user $ docker ps

CONTAINER ID   IMAGE                  NAMES
8e2d4649dfbd   apache/airflow:3.1.0   chapter02-airflow-worker-1
2229516745e6   apache/airflow:3.1.0   chapter02-airflow-apiserver-1
1e9ee7e33ec6   apache/airflow:3.1.0   chapter02-airflow-dag-processor-1
1f57735aa785   apache/airflow:3.1.0   chapter02-airflow-scheduler-1
ac23f91faab2   apache/airflow:3.1.0   chapter02-airflow-triggerer-1
7cd704c8fce4   postgres:16            chapter02-postgres-1
5b867091e894   redis:7.2-bookworm     chapter02-redis-1

Lists the containers created for the Airflow services and supporting infrastructure. section 2.3.2

How Data Pipelines with Apache Airflow, Second Edition covers it

How deep it goes
Explains isolation, host-kernel virtualization, Compose configuration, and startup commands, but stops short of detailed container internals.
Examples
Uses Airflow Compose files, docker compose up, docker ps, and a multi-service stack with PostgreSQL and Redis.
What it assumes
Assumes Docker Engine or Docker Desktop is installed and introduces containers, Compose, and YAML configuration.
What you can do after
Operate a local Airflow deployment with Docker Compose and inspect its running containers.
How it connects
Connects Docker with Docker Compose, containers, Airflow, Kubernetes, virtual machines, and container engines.

Also explained in

Compare how 26 books explain Docker →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Data Pipelines with Apache Airflow, Second Edition. The section links point to the parts of the book it draws on.