Week 07 — Containerization — Docker for ML

Build once, run anywhere — finally true for ML, with the right image discipline.

MLOps  ·  schedule  ·  Week 07 of 12 ·  ← 06 ·  08 →

Week 07 — Containerization — Docker for ML

Build once, run anywhere — finally true for ML, with the right image discipline.

Lecture

Docker fundamentals (image vs container, layers, cache) · multi-stage builds for slim ML images · CUDA base images · the .dockerignore discipline · security (CVE scanning, non-root users) · Docker Compose for local development.

Read before the lecture

Code lab

Lab 4 — Minimal ML inference image

Build a Docker image for a single-model inference service. Target image size under 500 MB. Document the multi-stage build choices. Push to Docker Hub or GitHub Container Registry.

Notebook: lab04-docker.ipynb  ·  Dataset: Model from Lab 3.


Reference text for this week: chapter 07 of the bilingual notes — EN PDF · FR PDF.