Bird
0
0

You run docker build --squash -t myapp . but get an error saying the flag is unknown. What is the most likely cause?

medium📝 Troubleshoot Q14 of 15
Docker - Image Optimization
You run docker build --squash -t myapp . but get an error saying the flag is unknown. What is the most likely cause?
AThe image tag is missing
BDocker experimental features are not enabled
CThe Dockerfile has syntax errors
DThe build context path is incorrect
Step-by-Step Solution
Solution:
  1. Step 1: Understand requirements for --squash flag

    The --squash flag requires Docker experimental features to be enabled.
  2. Step 2: Identify cause of unknown flag error

    If experimental features are off, Docker does not recognize --squash and throws an error.
  3. Final Answer:

    Docker experimental features are not enabled -> Option B
  4. Quick Check:

    Enable experimental features to use --squash [OK]
Quick Trick: Enable experimental features to use --squash [OK]
Common Mistakes:
  • Assuming Dockerfile errors cause unknown flag
  • Thinking missing tag causes flag error
  • Blaming build context path for flag issues

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes