Installing Docker CE with internet access

Use this procedure to install Docker CE on a host that has internet access.
  1. Log in to the host as root, or as a user with superuser privileges.
  2. Install Docker CE 17.03.1, and then disable accidental upgrades.
    1. Add the Docker CE repository to the host's repository list.
      cat <<EOF > /etc/yum.repos.d/docker-ce.repo
      name=Docker CE Stable - \$basearch
    2. Clean the yum cache and update repository metadata.
      yum clean all && yum makecache fast
    3. Install Docker CE from the remote repository.
      yum install -y --setopt=obsoletes=0 \
        docker-ce-17.03.1.ce-1.el7.centos \
    4. Enable automatic startup.
      systemctl enable docker
    5. Open /etc/yum.repos.d/docker-ce.repo with a text editor.
    6. Change the value of the enabled key from 1 to 0.
    7. Save the file, and then close the text editor.