CentOS-Base.repo
modify /etc/yum.repos.d/CentOS-Base.repo
1 | [BaseOS] |
CentOS-AppStream.repo
modify /etc/yum.repos.d/CentOS-AppStream.repo
1 | [AppStream] |
other
other file not avaliable in default, can change to ali repository as well.
https://mirrors.aliyun.com/centos/8/extras/x86_64/os/
reload matadatayum makecache
when modifying the source on a docker image, use the following description in the Dockerfile
to build1
2
3
4
5
6
7RUN mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo_bak
COPY CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo
RUN mv /etc/yum.repos.d/CentOS-AppStream.repo /etc/yum.repos.d/CentOS-AppStream.repo_bak
COPY CentOS-AppStream.repo /etc/yum.repos.d/CentOS-AppStream.repo
RUN yum makecache
http://www.voycn.com/article/centos8-peizhialiyuan-zuixiaohuaanzhuang