Reading · 11 min
Writing good Dockerfiles
You are previewing a free lesson. Enrol to save progress and take quizzes.
Each instruction in a Dockerfile creates a layer. Copy dependency files and install them before copying source code, so changing code does not reinstall everything. Multi-stage builds compile in one image and copy only the result into a small final image.
