docker 执行build yum失败

docker 执行build yum失败

月光魔力鸭

2023-05-02 23:53 阅读 648 喜欢 0

错误信息

docker build yum install Could not retrieve **

 > [2/2] RUN yum install -y wget:                                                                                                                                                                        
#0 0.308 Loaded plugins: fastestmirror, ovl
#0 0.367 Determining fastest mirrors
#0 0.373 
#0 0.373 
#0 0.373  One of the configured repositories failed (Unknown),
#0 0.373  and yum doesn't have enough cached data to continue. At this point the only
#0 0.373  safe thing yum can do is fail. There are a few ways to work "fix" this:
#0 0.373 
#0 0.373      1. Contact the upstream for the repository and get them to fix the problem.
#0 0.373 
#0 0.373      2. Reconfigure the baseurl/etc. for the repository, to point to a working
#0 0.373         upstream. This is most often useful if you are using a newer
#0 0.373         distribution release than is supported by the repository (and the
#0 0.373         packages for the previous distribution release still work).
#0 0.373 
#0 0.373      3. Run the command with the repository temporarily disabled
#0 0.373             yum --disablerepo=<repoid> ...
#0 0.373 
#0 0.373      4. Disable the repository permanently, so yum won't use it by default. Yum
#0 0.373         will then just ignore the repository until you permanently enable it
#0 0.373         again or use --enablerepo for temporary usage:
#0 0.373 
#0 0.373             yum-config-manager --disable <repoid>
#0 0.373         or
#0 0.373             subscription-manager repos --disable=<repoid>
#0 0.373 
#0 0.373      5. Configure the failing repository to be skipped, if it is unavailable.
#0 0.373         Note that yum will try to contact the repo. when it runs most commands,
#0 0.373         so will have to try and fail each time (and thus. yum will be be much
#0 0.373         slower). If it is a very temporary problem though, this is often a nice
#0 0.373         compromise:
#0 0.373 
#0 0.373             yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true
#0 0.373 
#0 0.373 Cannot find a valid baseurl for repo: base/7/x86_64
#0 0.373 Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=container error was
#0 0.373 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"

昨天刚安装完成docker的时候还是可以使用的,今天再用的时候就出现这个问题了(中间服务器是否重启不太清楚) 。

最后通过以下方法解决:原因是nameserver的问题

解决步骤

  1. 修改resolv.conf文件,增加nameserver
vim /etc/resolv.conf 

nameserver 8.8.8.8
nameserver 114.114.114.114
  1. 保存后如果重启的话,还会还原的这里需要进行锁定
chattr +i /etc/resolv.conf   //resolv被锁定,即使root也不能修改
  1. 如果需要继续修改
chattr -i /etc/resolv.conf
  1. 重启network 查看是否还存在(centos8)
systemctl restart NetworkManager

转载请注明出处: https://chrunlee.cn/article/docker-build-yum-error.html


感谢支持!

赞赏支持
提交评论
评论信息 (请文明评论)
暂无评论,快来快来写想法...
推荐
上一张中已经完成了比较简易的3D全景浏览,但是...这是写死在xml中的,对于我们实际的项目,这种情况是不可能适应的。所以,来了解下如何动态加载xml已经设置对应的热点。
很久之前学习chrome扩展插件的时候已经做过一个了,好久没咋用,最近又跑了一个存储服务,准备在配合这个服务做个图床,以后就用这个了,之前的服务器到期忘了迁移数据都没了,这次换了服务器,在家里了,估计以后不会再做了吧,这个算是最后一个了,有啥问题就在这个进行优化了。
前一阵子做了个图床,可以粘贴上传,查看服务器上的文件... 但是自己的服务器总是有问题..空间还小,就怕哪天没钱续费了。同事昨天想要一个七牛的图床,在网上找了下,只找到了 qiniu upload files插件,自己使用了下,挺好用,但是没有复制粘贴
上一章,我们学习和了解了websocket 是什么以及初始搭建,接下来,我们继续了解,如何进行广播以及对应的私聊呢。
最开始其实只是网站的一个小改版,导致的需要发送邮件的功能,本身功能不复杂,不做工具的话,几行代码应该就可以搞定的.. 不过后来想想,这个功能应该还是有一定的小需求的,就做成了工具。
通过frp做穿透实现https 访问本地http项目。
功能来源于客户需求。客户有需求想把班级内所有学生的错题本生成pdf文档下载下来... 目前没有做这个功能,只有页面,还好chrome浏览器有保存pdf的功能,但是一想到这么多的学生,这么多的学科、以及这么多的参数... 还好有puppeteer
之前做了一段时间的上传相关的断点续传和秒传功能,这里整理下大体思路