Dockerfile

What is a .dockerfile file?

Dockerfile contains instructions for building a Docker container image — defining the base OS, installed software, and startup commands.

Use caution
Type Code
By Docker Inc.
MIME text/plain

Drop any file to identify it

No upload. No signup. No sending your file halfway across the internet.
We tell you what it is, right here in your browser.

What is it

You're looking at a file literally called "Dockerfile" — no extension, no dot, just the name. It contains instructions for building a Docker container image: which base OS to start from, what software to install, which files to copy in, and what command to run when the container starts.

Dockerfiles use a simple declarative syntax. `FROM` picks the base image. `RUN` executes commands. `COPY` adds files. `CMD` sets the default startup command. Each instruction creates a cached layer, which means rebuilding after a small change is fast (only the changed layers rebuild). Getting the instruction order right — putting rarely-changing steps first — is the key to efficient Docker builds.

Any text editor opens Dockerfiles. VS Code with the Docker extension provides syntax highlighting, linting, and IntelliSense for Dockerfile instructions. To build an image: `docker build -t myapp .` in the directory containing the Dockerfile. Docker Desktop (free for personal use) provides the runtime. Never build a Dockerfile you haven't read — it can download and execute anything.

Technical details
Full Name
Dockerfile
MIME Type
text/plain
Developer
Docker Inc.
Magic Bytes
N/A
Safety
.dockerfile requires caution. Dockerfiles can download and execute arbitrary software. Review before building.
What opens it
Any text editor
FREE All
VS Code
FREE All
FAQ
Why doesn't a Dockerfile have a file extension?
Convention. Docker looks for a file named exactly 'Dockerfile' in the build context directory. You can use a different name with `docker build -f myfile .`, but the convention is to use 'Dockerfile' — no extension.
Is it safe to run someone else's Dockerfile?
Read it first. A Dockerfile can download and execute arbitrary software during the build. Check the FROM image source, review every RUN command, and be wary of scripts fetched from the internet with curl/wget.
Related formats