All jobs / DevOps / SRE / cloud / Containers
DevOps / SRE / cloud interview question · 0–1 years
A Dockerfile says `FROM node:latest`. What is wrong?
The strongest answer
latest moves; builds become unreproducible — I pin a digest or a version I can explain
Why it works
Exactly. Pin what you run. Patches come from a version you choose, not from a moving word.
What a good answer covers
- Pin versions or digests.
- latest is not a version.
- Patches are a choice, not a tag.
- Same pin in CI and prod.
Answers that fall short
- Close, but not the strongest: Nothing; latest means we always get security patches
latest is how Friday’s build is not Thursday’s. - Weak: latest is required by the registry
Registries do not require latest. - Red flag: I should use latest on prod and pin only in dev
Prod is the last place you want a moving base.
Who gets asked this
More Containers questions
- A container can take all the memory on the node. What do you set?
- In the team’s Docker Compose stack, Postgres loses all its data every time the container is recreated. Why…
- CI rebuilds a 12-minute Docker image on every commit. What do you change first?
- A production image is 1.8 GB and includes a compiler. What do you do?
- The app container connects to `localhost:5432` and gets connection refused, though the database container is…
- The Dockerfile has no USER line, so the app runs as root. Does that matter inside a container?
- The container registry has grown to terabytes, pulls from the cluster are slow, and a public registry started…
- What is the difference between an image and a container?