advancedTop 100 Interview Questions

What does `.dockerignore` do, and why does it matter for build performance?

It excludes specified files/directories from being sent to the Docker build context, which both speeds up the build (less data transferred to the daemon) and prevents accidentally copying sensitive files (like `.env` or `.git`) into an image via a broad COPY instruction.

This is a Pro chapter

Sign in, then upgrade to Pro or Power to unlock this and the full DevOps Mastery library.

What does `.dockerignore` do, and why does it matter for build performance?

Next Step

Continue to Why might a production Dockerfile explicitly set a non-root USER?← Back to all Docker questions