Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

docker

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.

like image 766
Haneef Mohammed Avatar asked Jun 27 '18 08:06

Haneef Mohammed


Video Answer


1 Answers

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.

like image 147
Konrad Botor Avatar answered Oct 16 '22 07:10

Konrad Botor