Back to Glossary
Containers

What is Dockerfile?

A text file with instructions for building a container image layer by layer.

A Dockerfile is a text document containing sequential instructions that Docker executes to build a container image. Each instruction (FROM, RUN, COPY, ENV, EXPOSE, CMD) creates a new layer. Layers are cached, so instructions that change infrequently (e.g., installing dependencies) should come before instructions that change often (e.g., copying app code). Multi-stage builds use multiple FROM statements to produce lean final images.

Deep Dive Guide

docker security best practices

Free Tool

dockerfile linter

Test your knowledge of Dockerfile and 130 other DevOps concepts