Docker Installation#

Install on CentOS#


To install Docker Engine, you need a maintained version of CentOS 7

Installation methods#

Install using the repository#

sudo yum install -y yum-utils
#yum-config-manager --add-repo
sudo yum-config-manager --add-repo

Install Docker Engine

  1. sudo yum install -y docker-ce docker-ce-cli docker-buildx-plugin docker-compose-plugin

    • Or: sudo yum install -y docker-ce docker-ce-cli

    • Or: sudo yum install -y --allowerasing docker-ce docker-ce-cli

  2. sudo systemctl start docker

  3. docker run hello-world

sudo systemctl stop docker
# Specific version
sudo yum list docker-ce --showduplicates | sort -r
sudo yum install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING> docker-buildx-plugin docker-compose-plugin

Install from a package#

#curl -o /etc/yum.repos.d/docker-ce.repo
curl -o /etc/yum.repos.d/docker-ce.repo
yum install

Uninstall Docker Engine#

  1. yum remove docker-ce docker-ce-cli

  2. rm -rf /var/lib/docker


CentOS 8 Errors:

  • Problem 1: problem with installed package podman-1.4.2-5.module_el8.1.0+237+63e26edc.x86_64

  • Problem 2: problem with installed package buildah-1.9.0-5.module_el8.1.0+237+63e26edc.x86_64

rpm -q podman
sudo dnf remove podman
rpm -q buildah
sudo dnf remove buildah
sudo systemctl enable docker
sudo mkdir /etc/docker
sudo vi /etc/docker/daemon.json
  "registry-mirrors": [""],
  "log-driver": "json-file",
  "log-opts": {"max-size":"500m", "max-file":"3"}
sudo systemctl daemon-reload
sudo systemctl restart docker


docker stop $(docker ps -aq)