Task 06 — Slim the Image
How to evaluate
csot submit ./solutions -w week-02 -t 06
Submit as: 06/Dockerfile
CI times out pushing a 1.2 GB image. The current Dockerfile uses the full
python:3.12 base and installs build tooling it never needs at runtime. Shrink
the runtime image while keeping the app working.
The app is the same server.py from Task 01 (returns {"ok":true} on /).
What the grader checks
docker buildsucceeds (4 pts)GET /still returns{"ok":true}(4 pts)- Final image is under 250 MB (4 pts)
Hints
python:3.12-slimorpython:3.12-alpineare dramatically smaller.- Multi-stage builds let you drop build-time tooling from the final stage.
- The reference bloated Dockerfile (for context):
FROM python:3.12
RUN apt-get update && apt-get install -y build-essential
WORKDIR /app
COPY . .
CMD python server.py