Installing Docker Compose on Centos 7

Docker Compose is a package manager that allows you to describe the required structure in one file (config).

Installing Docker

Installing the required packages

$ sudo yum install -y yum-utils device-mapper-persistent-data lvm2

Add the docker-ce repository

$ sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

Install Docker-CE

$ sudo yum install -y docker-ce

Add our user, under which we configure the OS, to the Docker group

$ sudo usermod -aG docker $(whoami)

Apply changes to groups

$ newgrp docker

Add the service to startup and start it

$ sudo systemctl enable --now docker

Installing Docker Compose

Add EPEL repository

$ sudo yum install -y epel-release

Install Python-pip

$ sudo yum install -y python-pip python-devel gcc
$ sudo yum install -y python3-pip

Installing Docker Compose

$ sudo pip3 install docker-compose

Making a symlink to the docker-compose file

$ sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

Updating the pip utility

$ sudo pip install --upgrade pip

Updating Python

$ sudo yum upgrade python*

Checking

$ sudo docker-compose version

Installing Docker Compose Method # 2

Download docker-compose to the / usr / local / bin / directory

$ sudo curl -L "https://github.com/docker/compose/releases/download/1.25.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

Making the file executable and creating a symlink

$ sudo chmod +x /usr/local/bin/docker-compose
$ sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
Sidebar