Command 1 - 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 -s
$ sudo yum install -y yum-utils device-mapper-persistent-data lvm2
Command 2 - Use the following command to set up the stable repository
$ sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
Command 3 - Install the latest version of Docker CE
$ sudo yum install –y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
$ sudo yum-config-manager --enable rhui-REGION-rhel-server-extras
$ sudo yum install -y docker-ce
$ sudo yum install docker-ce
Command 4 - Enable Docker
$ sudo systemctl enable docker
Command 5 - Start Docker and Verify Docker Installations
$ sudo systemctl start docker
$ docker -v
$ docker info