A developer wants `latest` base images always. Your view?
BeginnerScenarioImage design and Dockerfile decisions
Answer
Situation read → latest is a moving target; builds become non-reproducible.
What I'd do → Pin to a specific minor version (python:3.12-slim-bookworm) and ideally to a digest: FROM python:3.12-slim-bookworm@sha256:.... Let Renovate or Dependabot open PRs to bump tags and digests.
Why → You get reproducible builds and reviewable upgrades, and security patches still flow through automated PRs.
Interview tip → Tag for readability, digest for immutability; use both together.
More on Image design and Dockerfile decisions
A teammate's Node.js image is 1.2 GB. How do you approach shrinking it?BeginnerYou need to run `apt-get install` in a Dockerfile. How do you write it so the layer stays small and cache-safe?BeginnerWhen would you pick `COPY` over `ADD`?BeginnerA service must run a startup script and then the app. Should you use `CMD`, `ENTRYPOINT`, or both?BeginnerYour Docker build re-installs all Python dependencies on every code change. Fix it.BeginnerProduct asks for a container that runs both nginx and a Python app. What do you say?Beginner