6

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.

1

2 Answers 2

8

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.

Sign up to request clarification or add additional context in comments.

Comments

-2

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

1 Comment

Welcome to Stackoverflow, could you please elaborate a little more? Posts where most information is contained in link are discouraged (see this meta post).

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.