Recall & Review
beginner
What does 'squashing layers' mean in Docker?
Squashing layers means combining multiple image layers into one to reduce image size and improve efficiency.
Click to reveal answer
beginner
Why is squashing layers useful in Docker images?
It reduces the final image size, speeds up downloads, and makes the image easier to manage.
Click to reveal answer
intermediate
Which Docker command option allows squashing layers during build?
The option is
--squash used with docker build to combine layers.Click to reveal answer
intermediate
Does squashing layers affect Docker cache usage?
Yes, squashing can reduce cache efficiency because it merges layers, making incremental builds less effective.
Click to reveal answer
intermediate
How can you enable squashing layers in Docker BuildKit?
Set the environment variable
DOCKER_BUILDKIT=1 and use --squash with docker build.Click to reveal answer
What is the main benefit of squashing layers in Docker images?
✗ Incorrect
Squashing layers reduces the image size by combining multiple layers into one.
Which Docker build option enables layer squashing?
✗ Incorrect
The
--squash option is used to squash layers during a Docker build.What is a downside of squashing layers in Docker builds?
✗ Incorrect
Squashing reduces cache efficiency because it merges layers, making incremental builds less effective.
To use squashing with Docker BuildKit, what must you do?
✗ Incorrect
You must enable BuildKit with
DOCKER_BUILDKIT=1 and add --squash to the build command.Which of these is NOT true about squashing layers?
✗ Incorrect
Squashing layers reduces image size but does not necessarily speed up container startup.
Explain what squashing layers means in Docker and why it might be useful.
Think about how combining layers affects image size and build process.
You got /3 concepts.
Describe how to enable squashing layers when building a Docker image using BuildKit.
Remember the environment variable and the build command option.
You got /2 concepts.