Interview Prep/Real-World Interview/Write-a-Dockerfile tasks

Pin a base image so builds are reproducible and safe from tag changes.

AdvancedHands-onWrite-a-Dockerfile tasks
Answer
FROM python:3.12-slim@sha256:<digest-from-registry>
docker buildx imagetools inspect python:3.12-slim   # shows the index digest

Key trick → Tags are mutable and digests are not. Let Renovate bump the digest through PRs so you still get security patches, but each change is reviewed and traceable.

All Real-World Interview questions Roadmap: Interview readiness

More on Write-a-Dockerfile tasks