Courses
Docker Advanced: Builds and Containers That Hold Up in Production
Check Yourself: Faster Builds
Five scenario questions on layer order, cache mounts, multi-stage builds and static binaries. If you miss more than one, reread the lessons in this section.
Course content
Join this Course
Sign in to save your progress.
-
Faster Builds
-
BuildKit: Cache Mounts and Why Rebuilds Are Slow
-
Multi-Stage Builds Without Shipping the Compiler
-
-
-
Images That Don't Leak
-
Non-Root Users and Dropping Capabilities
-
Pin Digests, Base Image Updates and CVEs
-
-
-
Running Under Load
-
Resource Limits, Restart Policies and Healthchecks
-
Logging Drivers and What Happens When Disk Fills
-
-
-
Beyond One Compose File
-
Compose Profiles, Watch and Override Files
-
Private Registries and Auth Without Sticking Tokens in Files
-
-
-
Production Concerns
-
Read-Only Root Filesystems and tmpfs
-
Rolling a Service Forward on One Host
-
When Docker Desktop Is the Wrong Tool
-
-
- Final Check: Docker Advanced
1.
Your Dockerfile has COPY . . on line 3 and RUN pip install -r requirements.txt on line 4. Every time you change one line of Python code, the build downloads all packages again. What is the best first fix?
2.
You fixed the line order, and code edits are fast now. But when you add one package to requirements.txt, pip downloads every package again, including a large one that did not change. What helps here?
3.
A teammate puts files into a cache mount folder during the build and expects the program to read them at run time. The build passes, but the program fails in the container. Why?
4.
You build a Go service in one stage on golang:1.26-bookworm and copy the binary into a scratch image. The container fails to start with no such file or directory, even though the binary is clearly there. What is the most likely cause?
The binary was built with cgo enabled and needs a C library and loader that scratch does not have. Build with CGO_ENABLED=0 or use a runtime base that has the library.
The binary is in the wrong folder, it must be in /bin.
scratch images cannot run Go programs.
The image is too small for the program.
5.
Why does a multi-stage build make an image safer, not only smaller?
About
Five scenario questions on layer order, cache mounts, multi-stage builds and static binaries. If you miss more than one, reread the lessons in this section.
- Duration
- 5 min
- Last update
- 08/01/2026
Was this helpful?
0
0
Comments (0)
Sign in to commentNo comments yet.