Suggest an editImprove this articleRefine the answer for “How is Compose different from a Dockerfile?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)A **Dockerfile** is an instruction for how to build an image, while **Docker Compose** is a tool for how to run several containers together. **Key point:** `Dockerfile` creates an image → `docker-compose.yml` starts the needed number of containers, links them, and brings up the whole environment with one command.Shown above the full answer for quick recall.Answer (EN)ImageA **Dockerfile** is an instruction for **how to build an image**. It describes what should be inside the container: packages, dependencies, files, build and run commands. **Docker Compose** is a tool for **how to run several containers together**, configuring their links, ports, volumes, environment variables, and so on. It uses already-built images (including ones built from a Dockerfile). In short: | Question | Dockerfile | Docker Compose | |---|---|---| | Task | Build an image | Run and orchestrate several containers | | Format | Instructions for creating an environment | Description of services, networks, and volumes | | Level | One container | Several services as one system | The usual pairing is: `Dockerfile` creates the image → `docker-compose.yml` starts the needed number of containers, links them, and brings up the whole environment with one command.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.