【Docker】Fixing the Repository Not Found Error When Installing Docker with yum on CentOS 8.0

When installing Docker on an Alibaba Cloud server running CentOS 8, a repository not found error occurred, as shown below:

img

Solution

Approach: Install Docker using the Docker repository.

Set Up the Repository

Install the required packages. Here, yum-utils is installed; yum-utils provides yum-config-manager, while the device mapper storage driver requires device-mapper-persistent-data and lvm2.

1
2
3
sudo yum install -y yum-utils \
  device-mapper-persistent-data \
  lvm2

Configure the Alibaba Cloud Mirror in China

1
2
3
sudo yum-config-manager \
    --add-repo \
    http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

Install docker-ce

1
sudo yum install docker-ce docker-ce-cli containerd.io

P.S. If the installation fails, click here.

Built with Hugo
Theme Stack designed by Jimmy