Suggest an editImprove this articleRefine the answer for “How does a Dockerfile differ from an image?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)A **Dockerfile** is a recipe (a set of instructions on how to build an image), while a **Docker image** is the finished dish that results from executing those instructions. **Key point:** a Dockerfile describes how to create an image, while an image is the final artifact that runs a container.Shown above the full answer for quick recall.Answer (EN)ImageThe difference is simple: - A **Dockerfile** is a **recipe** (a set of instructions on how to build an image). - A **Docker image** is the **finished dish** that results from executing those instructions. --- ### Breakdown step by step | Object | What it is | Analogy | |---|---|---| | **Dockerfile** | a text file with commands (`FROM`, `RUN`, `COPY`, `CMD`, etc.) | recipe | | **Docker image** | the result of building from the Dockerfile, a ready filesystem and environment | finished dish | --- ### The connection 1. You write a **Dockerfile** 2. You run: ```bash docker build -t myimage . ``` 3. Docker **reads the Dockerfile** and creates an **image** 4. A container can be run from the image: ```bash docker run myimage ``` --- ### The main difference in one phrase > A Dockerfile describes how to create an image, while an image is the final artifact that runs a container.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.