Intermediate Docker & Containers
Q70 / 100

What does "docker build --no-cache" do, and when might it be needed?

Correct! Well done.

Incorrect.

The correct answer is B) It forces every instruction in the Dockerfile to be re-executed from scratch, ignoring any cached layers — useful when cached layers might be stale, e.g. if a RUN command fetches external resources that have changed

B

Correct Answer

It forces every instruction in the Dockerfile to be re-executed from scratch, ignoring any cached layers — useful when cached layers might be stale, e.g. if a RUN command fetches external resources that have changed

Explanation

"--no-cache" ensures a completely fresh build, useful when cached layers (like "apt-get update" results or downloaded dependencies) might no longer reflect the current state of external resources.

Progress
70/100