.dockerignore
🔧 ConfigText-based

.dockerignore File — Docker Ignore File

text/plain

File Inspector

Drop any file to identify its extension and type — runs entirely in your browser

DOCKERIGNORE

Drop a .dockerignore file here or click to choose

Or drop any file to identify its extension

Expected MIME type:text/plain

Quick Facts

Extension.dockerignore
Full NameDocker Ignore File
MIME Typetext/plain
CategoryConfig
TypeText-based (human-readable)
Typical Size100 B – 2 KB
First Appeared2014

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

VS Code
any text editor
vim
Sublime Text

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.