Interview Prep/Docker/Image design and Dockerfile decisions

You want to know exactly what commands produced an image you did not build.

BeginnerScenarioImage design and Dockerfile decisions
Answer

Situation read → Image metadata keeps a build history.

What I'd do →

docker history --no-trunc --format '{{.CreatedBy}}' nginx:1.27
docker inspect nginx:1.27 | jq '.[0].Config'

For deeper layer content use dive nginx:1.27 or docker save and untar. For BuildKit images also docker buildx imagetools inspect --format '{{json .Provenance}}' image.

Why → History shows instructions; attestations give signed provenance when published.

Interview tip → History can be forged or squashed, so for trust use signatures and provenance.

All Docker questions Roadmap: Docker & containers

More on Image design and Dockerfile decisions