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

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