Skip to content

Docker

Docker Build Process DAG

docker build possible execution paths.

Flow Chart, of how exection navigates docker stages (see --target of docker build).

If you run docker build . the target used by default is the default_with_demo Stage in the Graph.

Dockerfile: ./Dockerfile

  • Nodes represent docker stages
  • Continuous arrows/edges represent FROM A AS B docker statements
  • Dotted arrows/edges represent COPY --from=A /path/to/file /local/path statements

Dockerfile Flow Chart

Dockerfile: Dockerfile

graph TB;
  python_slim --> builder
  builder --> prod_builder
  builder --> test_builder
  builder --> docs_builder
  builder --> docs_live_builder
  scratch --> source
  prod_builder -. "/app/requirements.txt" .-> source
  python_slim --> base_env
  base_env --> build_wheels
  source -. "/app" .-> build_wheels
  base_env --> install
  build_wheels -. "${DISTRO_WHEELS}" .-> install
  python_slim --> test_dev
  test_builder -. "/app/requirements-test.txt" .-> test_dev
  base_env --> test_wheels
  build_wheels -. "${DISTRO_WHEELS}" .-> test_wheels
  test_builder -. "/app/requirements-test.txt" .-> test_wheels
  python_slim --> docs_base
  docs_base --> docs
  docs_base --> docs_live
  install --> prod

With this multi-stage Dockerfile design, stages can be built in parallel (assuming appropiate build backend)!