Bird
0
0

When running docker build --squash results in an "unknown flag" error, what is the most probable reason?

medium📝 Troubleshoot Q6 of 15
Docker - Image Optimization
When running docker build --squash results in an "unknown flag" error, what is the most probable reason?
AThe Dockerfile syntax is incorrect
BThe Docker daemon version does not support the --squash flag
CThe build context directory is missing
DThe image tag is not specified
Step-by-Step Solution
Solution:
  1. Step 1: Understand flag support

    The --squash flag requires experimental features enabled or a newer Docker version.
  2. Step 2: Check error cause

    "Unknown flag" usually means the CLI does not recognize the flag due to version or config.
  3. Final Answer:

    The Docker daemon version does not support the --squash flag -> Option B
  4. Quick Check:

    Unsupported flags cause unknown flag errors [OK]
Quick Trick: Unsupported Docker version causes unknown flag error [OK]
Common Mistakes:
  • Assuming Dockerfile syntax causes flag errors
  • Blaming missing build context
  • Thinking missing tag causes flag errors

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes