Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No URLs in mirrorlist #7

Open
Artio-Li opened this issue Feb 16, 2022 · 5 comments
Open

No URLs in mirrorlist #7

Artio-Li opened this issue Feb 16, 2022 · 5 comments

Comments

@Artio-Li
Copy link

使用命令构建镜像:
docker build --build-arg JDK_PKG=jdk-jdk-8u171-linux-x64.tar.gz --build-arg WEBLOGIC_JAR=fmw_12.2.1.4.0_wls_lite_generic.jar -t weblogic12014jdk8u171 .
然后会报如下错误:
[+] Building 6.0s (6/27)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 170B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/centos:latest 1.4s
=> CACHED [ 1/23] FROM docker.io/library/centos@sha256:a27fd8080b517143c 0.0s
=> CANCELED [internal] load build context 4.5s
=> => transferring context: 186.17MB 4.5s
=> ERROR [ 2/23] RUN yum -y install libnsl 4.5s

[ 2/23] RUN yum -y install libnsl:
#5 4.341 CentOS Linux 8 - AppStream 11 B/s | 38 B 00:03
#5 4.343 Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist

百度了下说是centos 8 于2021年12月31日停止了源的服务,需要修改yum的源等等操作,但是我用的是mac,这个怎么解决?

@ajisai-babu
Copy link

在Dockerfile里添加
RUN cd /etc/yum.repos.d/
RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

@bibotai
Copy link
Collaborator

bibotai commented Apr 14, 2022

在Dockerfile里添加 RUN cd /etc/yum.repos.d/ RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

感谢解答,看来外部环境越来越复杂了,我需要重新测试Dockerfile了,可以暂时采用此操作解决

@benjiamin911
Copy link

benjiamin911 commented Aug 3, 2022

在Dockerfile里添加 RUN cd /etc/yum.repos.d/ RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

更改了这个还是不行欸 我是在Kali上搭建的

@highwayMo
Copy link

在Dockerfile里添加 RUN cd /etc/yum.repos.d/ RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

更改了这个还是不行欸 我是在Kali上搭建的

添加到Dockerfile的

# 解决libnsl包丢失的问题
RUN cd /etc/yum.repos.d/
#添加到这里
RUN cd /etc/yum.repos.d/
RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
RUN sed -i 's|#baseurl=[http://mirror.centos.org|baseurl=http://vault.centos.org|g](http://mirror.centos.org%7Cbaseurl%3Dhttp//vault.centos.org%7Cg)' /etc/yum.repos.d/CentOS-*

@benjiamin911
Copy link

benjiamin911 commented Sep 8, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants