Haneef Mohammed
Haneef Mohammed

Reputation: 1164

What is the difference between docker-compose file and docker file?

I am relatively new to docker and exploring it.I want to know what is the basic difference between a docker-compose.yml file and a simple docker file.

Upvotes: 6

Views: 4613

Answers (2)

WilliamDk
WilliamDk

Reputation: 141

Dockerfile helps you to build a docker image and docker-compose helps you to simply start your application. For more please click here

Upvotes: -2

Konrad Botor
Konrad Botor

Reputation: 5063

Dockerfile describes how to build a Docker image - it's essentially Docker's version of Makefile or pom.xml or build.gradle

docker-compose.yml describes how the image is to be deployed, that is all the things necessry to create both the container and the environment it needs to run (like networks or volumes). If several containers need to work together the description of how to deploy them together, in which order, how to link them an so on can be put into a single docker-compose.yml

See documentation for Dockerfile and docker-compose.yml for more information.

Upvotes: 8

Related Questions