Install on CentOS 7.1/7.2 & RHEL 7.0/7.1/7.2/7.3 (YUM-based systems)

1、Add the Docker public key for CS Docker Engine packages:

sudo rpm --import "https://sks-keyservers.net/pks/lookup?op=get&search=0xee6d536cf7dc86e2d7d56f59a178ac6c6238f52e"

2、Install yum-utils if necessary

sudo yum install -y yum-utils

3、Add the Docker repository:

  sudo yum-config-manager --add-repo https://packages.docker.com/1.13/yum/repo/main/centos/7

 

4、Install Docker CS Engine:

$ sudo yum makecache fast

$ sudo yum install docker-engine

5、Specific version:

   yum list docker-engine.x86_64 --showduplicates |sort -r

   sudo yum install docker-engine-<version>

 

6、Configure the Docker daemon to start automatically when the system starts, and start it now.

$ sudo systemctl enable docker.service
$ sudo systemctl start docker.service