0
0
Dockerdevops~5 mins

Squashing layers in Docker - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
ASmaller image size
BFaster container startup
CMore layers created
DImproved network speed
Which Docker build option enables layer squashing?
A--flatten
B--compress
C--squash
D--merge
What is a downside of squashing layers in Docker builds?
AReduced cache efficiency
BSlower build times
CIncreased image size
DMore complex Dockerfiles
To use squashing with Docker BuildKit, what must you do?
AUse --compress flag only
BSet DOCKER_BUILDKIT=1 and use --squash
CEnable experimental Docker mode
DNo special setup needed
Which of these is NOT true about squashing layers?
AIt merges multiple layers into one
BIt may reduce build cache effectiveness
CIt can reduce image size
DIt always speeds 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.