Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 678
user6140806 Avatar asked Jan 20 '26 21:01

user6140806


1 Answers

You should use the following 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

like image 124
Adivinho Avatar answered Jan 22 '26 12:01

Adivinho



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!