upgrade docker engine package to docker-ce on CentOS

Older version of Docker were called docker or docker-engine. The Docker Engine package is now called docker-ce .

  1. uninstall old versions

    1
    2
    3
    4
    5
    6
    7
    8
    sudo yum remove docker \
    docker-client \
    docker-client-latest \
    docker-common \
    docker-latest \
    docker-latest-logrotate \
    docker-logrotate \
    docker-engine
  2. set up the repository

    1
    2
    3
    4
    5
    sudo yum install -y yum-utils

    sudo yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo
  3. install Docker Engine

    1
    sudo yum install docker-ce docker-ce-cli containerd.io
  4. start Docker

    1
    sudo systemctl start docker
  5. verify that Docker Engine is installed correctly by running the hello-world image.

    1
    sudo docker run hello-world
  6. upgrade Docker Engine

    1
    yum -y upgrade docker-ce
  7. view docker version number

    1
    docker version --format {{.Server.Os}}-{{.Server.Version}}