skip to Main Content

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?

2

Answers


  1. According to https://www.centos.org/download/mirrors/
    Starting from CentOS Stream 9 , mirrors are listed in Mirrormanager so use this link – https://mirrormanager.fedoraproject.org/mirrors/CentOS

    Login or Signup to reply.
  2. 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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search