Updating to Docker CE

Use this procedure to update Docker to Docker Community Edition (Docker CE) version 17.03.1.
  1. Log in as root, or as a user with superuser privileges.
  2. Remove the Docker repository description file.
    Docker CE uses a different file.
    rm -f /etc/yum.repos.d/docker.repo
  3. Update the Linux kernel, if necessary.
    1. Determine which kernel version is installed.
      uname -r
      If the result is lower than 3.10.0-327.22.2.el7.x86_64, perform the following substeps.
    2. Disable automatic start of serviced.
      systemctl disable serviced
    3. Update the kernel, and then restart the host.
      The following commands require internet access or a local mirror of operating system packages.
      yum makecache fast && yum update -y kernel && reboot
    4. Log in as root, or as a user with superuser privileges.
    5. Enable automatic start of serviced.
      systemctl enable serviced
  4. Install the Docker CE repository description file.
    cat <<EOF > /etc/yum.repos.d/docker-ce.repo
    [docker-ce-stable]
    name=Docker CE Stable - \$basearch
    baseurl=https://download.docker.com/linux/centos/7/\$basearch/stable
    enabled=1
    gpgcheck=1
    gpgkey=https://download.docker.com/linux/centos/gpg
    EOF
  5. Remove Docker 1.12.1 without checking dependencies.
    rpm -e --nodeps docker-engine-1.12.1
  6. Install Docker CE 17.03.1.
    yum install -y --disablerepo=\* --enablerepo=zenoss-mirror \
      docker-ce-17.03.1.ce
  7. Disable unintended Docker CE updates.
    1. Open /etc/yum.repos.d/docker-ce.repo with a text editor.
    2. Change the value of the enabled key from 1 to 0.
    3. Save the file, and then close the text editor.