Interview Prep/Docker/Build failures and cache problems

`ARG` value is empty during `RUN`: `echo $VERSION` prints nothing.

IntermediateTroubleshootingBuild failures and cache problems
Answer

Likely causes → ARG declared before FROM (out of stage scope), declared in a previous stage, or not passed with --build-arg.

Diagnose → Read the Dockerfile; run with --progress=plain.

Fix → Redeclare ARG VERSION after FROM in the stage that needs it; pass --build-arg VERSION=1.2.

Prevent → Keep ARG declarations next to usage.

All Docker questions Roadmap: Docker & containers

More on Build failures and cache problems