Friday, April 22, 2022

[SOLVED] Problem with moby packages when installing docker-ce on CentOS 7

Issue

I have a docker image for CentOS 7 which installs docker-ce via the recommended instructions. i.e.

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

Recently this stopped working and now fails as follows:

--> 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

If the install command is replaced with:

yum install -y docker

I get a different error to do with an unsigned package:

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

I tried forcing use of a few old versions as below to no avail e.g.

RUN yum install -y docker-1.13.1-102.git7f2769b.el7.centos

Why is this happening? How can I fix it? And how can I prevent similar problems in the future?


Update: A critical missing piece of information from this question is the use of Azure. I had the following as aspnetcore is required to publish packages in an Azure devops pipeline:

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

Solution

my repo's needed to be updated --- the following resolved me:

curl https://packages.microsoft.com/config/rhel/7/prod.repo > ./microsoft-prod.repo
sudo cp ./microsoft-prod.repo /etc/yum.repos.d/
yum update -y

https://docs.microsoft.com/en-us/windows-server/administration/linux-package-repository-for-microsoft-software



Answered By - user8475213
Answer Checked By - Gilberto Lyons (WPSolving Admin)