我有一个 CentOS 7 的 docker 映像,它通过推荐的说明安装 docker-ce 。IE
RUN yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
RUN yum install -y yum-utils \
device-mapper-persistent-data \
lvm2
RUN yum update -y
RUN yum install -y docker-ce docker-ce-cli containerd.io
最近这停止工作,现在失败如下:
--> Processing Conflict: moby-containerd-1.3.6+azure-1.x86_64 conflicts containerd
--> Processing Conflict: moby-runc-1.0.0~rc10+azure-2.x86_64 conflicts runc
--> Finished Dependency Resolution
Error: moby-containerd conflicts with containerd.io-1.2.13-3.2.el7.x86_64
Error: moby-runc conflicts with containerd.io-1.2.13-3.2.el7.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
The command '/bin/sh -c yum install -y docker-ce docker-ce-cli containerd.io' returned a non-zero code: 1
如果安装命令被替换为:
yum install -y docker
我得到一个与未签名包有关的不同错误:
Package runc is obsoleted by moby-runc, trying to install moby-runc-1.0.0~rc10+azure-2.x86_64 instead
...
Package moby-runc-1.0.0~rc10+azure-2.x86_64.rpm is not signed
我尝试强制使用以下几个旧版本无济于事,例如
RUN yum install -y docker-1.13.1-102.git7f2769b.el7.centos
为什么会这样?我该如何解决?以及如何防止将来出现类似问题?
更新:此问题中缺少的一条重要信息是 Azure 的使用。我有以下内容,因为在 Azure devops 管道中发布包需要 aspnetcore:
RUN rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm
RUN yum update -y && yum install aspnetcore-runtime-3.1 -y