Question

Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=container

I'm currently running into an issue with my docker builds that rely on centos7 I reference the image as follows: FROM centos:7

Error: `Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=genclo error was

curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"`

I understand centos7 was EOL on June 30, 2024; however, I didn't think this would break builds? Is there something I'm missing and need to change on my end? Do I need to point to a different image?

 6  11594  6
1 Jan 1970

Solution

 17

You should use next commands inside your docker container

sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

enter image description here

2024-07-01
Adivinho