.dockerignore File — Docker Ignore File
text/plain
Drop any file to identify its extension and type — runs entirely in your browser
Drop a .dockerignore file here or click to choose
Or drop any file to identify its extension
text/plainQuick Facts
| Extension | .dockerignore |
| Full Name | Docker Ignore File |
| MIME Type | text/plain |
| Category | Config |
| Type | Text-based (human-readable) |
| Typical Size | 100 B – 2 KB |
| First Appeared | 2014 |
What Is a .dockerignore File?
DOCKERIGNORE files specify files and directories that should be excluded from the Docker build context when building container images. When Docker builds an image, it sends the entire build directory to the Docker daemon as the build context — the .dockerignore file prevents unnecessary files from being included, reducing build context size, improving build speed, and preventing sensitive files from being accidentally included in images. The syntax is similar to .gitignore, supporting glob patterns, negation with !, and comments with #. Common patterns include excluding node_modules, .git directories, local environment files (.env), build artifacts, documentation, test files, and IDE configuration. Excluding large directories like node_modules from the build context can dramatically reduce build times since the entire context must be transferred to the Docker daemon before building begins. A well-crafted .dockerignore is essential for efficient Docker builds, particularly in CI/CD pipelines where build time directly impacts deployment speed. The file also serves a security purpose — excluding .env files, SSH keys, and other secrets prevents them from being available during the build process and potentially cached in image layers.
How to Open .dockerignore Files
Related File Extensions
More Config File Extensions
Other config formats you might encounter
Browse File Extensions by Category
Explore our reference of 259 file extensions with details, programs, and related formats.