命令:
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo && yum -y install docker-ce-cli --allowerasing
错误:
Step 18/19 : RUN yum install -y yum-utils && yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo && yum -y install docker-ce-cli --allowerasing
---> Running in 4374fa671570
Updating Subscription Management repositories.
Unable to read consumer identity
Subscription Manager is operating in container mode.
This system is not registered with an entitlement server. You can use subscription-manager to register.
Last metadata expiration check: 0:00:18 ago on Fri Aug 25 13:52:40 2023.
Package yum-utils-4.0.21-19.el8_8.noarch is already installed.
Dependencies resolved.
Nothing to do.
Complete!
Updating Subscription Management repositories.
Unable to read consumer identity
Subscription Manager is operating in container mode.
This system is not registered with an entitlement server. You can use subscription-manager to register.
Adding repo from: https://download.docker.com/linux/centos/docker-ce.repo
Updating Subscription Management repositories.
Unable to read consumer identity
Subscription Manager is operating in container mode.
This system is not registered with an entitlement server. You can use subscription-manager to register.
Docker CE Stable - x86_64 8.2 kB/s | 961 B 00:00
Errors during downloading metadata for repository 'docker-ce-stable':
- Status code: 404 for https://download.docker.com/linux/centos/8/x86_64/stable/repodata/ed67480d9d2325c2bde62bf77f5111a8845162f50d91521e5d0b2985e1539f71-primary.xml.gz (IP: 13.32.151.81)
- Status code: 404 for https://download.docker.com/linux/centos/8/x86_64/stable/repodata/b1627cb5314e821c4f725e02661ece5b90e6e59ba01ef8d26c3f47f21b9dffd4-filelists.xml.gz (IP: 13.32.151.81)
Error: Failed to download metadata for repo 'docker-ce-stable': Yum repo downloading error: Downloading error(s): repodata/ed67480d9d2325c2bde62bf77f5111a8845162f50d91521e5d0b2985e1539f71-primary.xml.gz - Cannot download, all mirrors were already tried without success; repodata/b1627cb5314e821c4f725e02661ece5b90e6e59ba01ef8d26c3f47f21b9dffd4-filelists.xml.gz - Cannot download, all mirrors were already tried without success
The command '/bin/sh -c yum install -y yum-utils && yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo && yum -y install docker-ce-cli --allowerasing' returned a non-zero code: 1
您的网络似乎有问题 检查您的名称服务器或添加流行的名称服务器,例如 1.1.1.1 、 8.8.8.8 如果它不起作用尝试这个: 卷曲-fsSL https://get.docker.com/ |嘘 sudo systemctl 启动 docker 这将下载 docker 存储库并自动安装