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
    name=Docker CE Stable - \$basearch
  5. Stop the Docker service.
    systemctl stop docker
  6. Remove Docker 1.12.1 without checking dependencies.
    rpm -e --nodeps docker-engine-1.12.1
  7. Install Docker CE 17.03.1.
    With internet access:
    yum clean all && yum makecache fast
    yum install -y --setopt=obsoletes=0 \
      docker-ce-17.03.1.ce-1.el7.centos \
    Without internet access:
    yum install -y --disablerepo=\* --enablerepo=zenoss-mirror \
  8. 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.