Docker · 12-day planAll days
Day 8 of 12 30 minLayersCache.dockerignore
Understand image layers and the build cache, so rebuilds take seconds instead of minutes. Order instructions so dependencies are cached, keep junk and secrets out with .dockerignore, compare base images to make images smaller, and learn CMD vs ENTRYPOINT.
By the end of today you can
- Explain how each instruction creates a layer and when the cache is reused
- Order a Dockerfile so dependency installs stay cached
- Keep files out of the image with .dockerignore
- Make images smaller by choosing the right base image
- Choose between CMD and ENTRYPOINT
What's inside
- 5 sections
- 2 diagrams and mind maps
- 5 code examples you can run
- 5-question quiz
- 1Layers and the cache
- 2Order matters
- 3.dockerignore
- 4Smaller images
- 5CMD vs ENTRYPOINT
Sign in free to read this lesson
Get the full lesson with diagrams, runnable code and the quiz. Your progress is saved across devices.
Sign in free