Skip to content

Latest commit

 

History

History
77 lines (61 loc) · 2.31 KB

install_docker_on_centos_fedora.md

File metadata and controls

77 lines (61 loc) · 2.31 KB

Installation of Docker on CentOS and Fedora

Table of content

Prerequisites

The centos-extras repository must be enabled. By default it is enabled, but if you have disabled it, you need to re-enable it.

Uninstall old versions

Older versions of Docker were called docker or docker-engine. If these are installed, uninstall them, along with associated dependencies.

sudo yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-engine

It’s OK if yum reports that none of these packages are installed.

The contents of /var/lib/docker/, including images, containers, volumes, and networks, are preserved. The Docker Engine package is now called docker-ce.

Set up the repository

Install the yum-utils package (which provides the yum-config-manager utility) and set up the stable repository.

 sudo yum install -y yum-utils
 sudo yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo

enables the docker nightly repository.

sudo yum-config-manager --enable docker-ce-nightly

Install Docker Engine

  1. Install the latest version of Docker Engine and containerd, or go to the next step to install a specific version:
sudo yum install docker-ce docker-ce-cli containerd.io

If prompted to accept the GPG key, verify that the fingerprint matches 060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35, and if so, accept it.

  1. Start Docker.
sudo systemctl start docker
  1. Enable docker service on system startup.
sudo systemctl enable docker
  1. Verify that Docker Engine is installed correctly by running the hello-world image.
 sudo docker run hello-world

Install On Other Platforms