docker-compose and docker stack1 min read

Prabhin Prabharkaran Administrator
DevOps Engineer

He is a Technical professional. He is a person who loves to share tricks and tips on the Internet. He Posts what he does!

follow me

Docker is a platform that depends on the operating system in applications that are packaged and deployed as containers. By using docker, the applications which designed in a way of microservices architecture deployments became very easy and scalable compared to the monolithic architecture.

Most of the people who are new to docker have confusion what is the difference between docker-compose and docker stack. Let’s look into the difference from each search

 Installation

Docker-compose is an official tool by docker which can be used to manage and build a docker image and docker containers. This tool doesn’t come with the normal installation of the docker engine. Whereas docker stack is a command embedded in the Docker engine.

Usage

 

Docker-compose and docker stack both support docker-compose.yml and features are picked from the YAML file based on the tool or command which are getting executed.
Docker-compose can manage only a single server where docker-compose is installed. Docker stack invokes docker swarm where it can manage which are joined to docker swarm manager. Docker stack only from the node which has a manager role is assigned.

Below are the commands used to be each one

docker-compose -f docker-compose up
docker stack deploy -c docker-compose.yml stackname

Docker-compose can build a docker image during the deployment whereas docker stack can manage only docker containers and its deployment. Build features are not available in the docker stack.

Features

As I said before there feature difference between docker stack and docker-compose, for example, depends_on work on docker-compose whereas it won’t support in docker stack. Another example is Placement constraints works with docker stack, it won’t work with docker-compose.

 

© 2020, Techrunnr. All rights reserved.

#1
#2
#3
Questions Answered
Articles Written
Overall Points

Related posts

Leave a Reply