Skip to content

Instantly share code, notes, and snippets.

@odaku
Last active February 1, 2023 20:57
Show Gist options
  • Save odaku/134ee071ee10cfbea0f735e3688afd0a to your computer and use it in GitHub Desktop.
Save odaku/134ee071ee10cfbea0f735e3688afd0a 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 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