How To Install docker-compose on CentOS 7

In this tutorial we learn how to install docker-compose on CentOS 7. docker-compose is Multi-container orchestration for Docker

Introduction

In this tutorial we learn how to install docker-compose on CentOS 7.

What is docker-compose

Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a Compose file to configure your application’s services. Then, using a single command, you create and start all the services from your configuration. Compose is great for development, testing, and staging environments, as well as CI workflows. Using Compose is basically a three-step process. 1. Define your app’s environment with a Dockerfile so it can be reproduced anywhere. 2. Define the services that make up your app in docker-compose.yml so they can be run together in an isolated environment 3. Lastly, run docker-compose up and Compose will start and run your entire app.

We can use yum or dnf to install docker-compose on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install docker-compose.

Install docker-compose on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

After updating yum database, We can install docker-compose using yum by running the following command:

sudo yum -y install docker-compose

Install docker-compose on CentOS 7 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

After updating yum database, We can install docker-compose using dnf by running the following command:

sudo dnf -y install docker-compose

How To Uninstall docker-compose on CentOS 7

To uninstall only the docker-compose package we can use the following command:

sudo dnf remove docker-compose

References

Summary

In this tutorial we learn how to install docker-compose on CentOS 7 using yum and dnf.