Interview Prep/Docker/Build failures and cache problems

Dockerfile `RUN --mount=type=cache` is ignored/errors: `the --mount option requires BuildKit`

BeginnerTroubleshootingBuild failures and cache problems
Answer

Likely causes → Legacy builder in use (old Docker, DOCKER_BUILDKIT=0).

Diagnose → docker version; echo $DOCKER_BUILDKIT.

Fix → Upgrade to Docker 23+ (BuildKit default) or DOCKER_BUILDKIT=1; add the # syntax= line.

Prevent → Pin builder tooling in CI.

All Docker questions Roadmap: Docker & containers

More on Build failures and cache problems