Docker installation on Linux

OS requirements
To install Docker CE, you need a maintained version of CentOS 7. Archived versions aren’t supported or tested.

The centos-extras repository must be enabled.

SET UP THE REPOSITORY
Install required packages. yum-utils provides the yum-config-manager utility, and device-mapper-persistent-data and lvm2 are required by the devicemapper storage driver.

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


Use the following command to set up the stable repository.

The overlay2 storage driver is recommended

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

INSTALL DOCKER CE
Install the latest version of Docker CE and containerd, or go to the next step to install a specific version:

$ sudo yum install docker-ce docker-cecli 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.