Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save i-amolo/9fcd5759862bb03f7a5e2c39a2bd61b5 to your computer and use it in GitHub Desktop.
Save i-amolo/9fcd5759862bb03f7a5e2c39a2bd61b5 to your computer and use it in GitHub Desktop.
docker and docker compose installation guide

Install Docker CE


Update the CentOs 7 package manager

# yum update
# yum upgrade
# yum clean all

Make sure that you don't have a docker version installed on your system

# yum remove docker docker-engine docker-common docker-selinux docker-ce docker-ce-cli containerd.i

Install the required packages

# yum install -y yum-utils device-mapper-persistent-data lvm2
# yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

Install Container SeLinux , prerequisite for latest Docker

# yum -y install http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.119.2-1.911c772.el7_8.noarch.rpm

Install Docker Community Edition

# yum install docker-ce docker-ce-cli containerd.io
The images, containers, volumes and configurations are stored in the directory /var/lib/docker

Launch the docker daemon and enable it to boot when your system turned on

# systemctl start docker.service
# systemctl enable docker.service

Add your user into docker group

$ sudo usermod -aG docker $(whoami)

Install Docker-Compose


Install linux Enterprise packages

# yum install epel-release

Install python-pip and update it

# yum install -y python-pip
# yum upgrade python*

Install docker-compose

# pip install docker-compose

verify the installation of docker and docker-compose

# docker -v
Docker version 18.09.4, build d14af54266

# docker-compose -v
docker-compose version 1.23.2, build 1110ad0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment