工作中需要部署docker,由于是内网环境,无法直接访问外网,于是考虑在内网搭建yum私有源进行安装,内网服务器操作系统为centos 7.4。根据docker的官方安装方式进行安装时,要求安装 epel-release 以及 container-selinux。

于是进行同步base以及epel源,reposync base && reposync epel

到内网环境中,通过 createrepo ./的方式创建私有源,并在另一台服务器上逐步安装,当安装完毕epel-release后,再进行安装container-selinux时,出现错误。

已加载插件:fastestmirror
base | 3.6 kB 00:00:00 One of the configured repositories failed (未知),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this: 1. Contact the upstream for the repository and get them to fix the problem. 2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work). 3. Disable the repository, so yum won't use it by default. Yum will then
just ignore the repository until you permanently enable it again or use
--enablerepo for temporary usage: yum-config-manager --disable <repoid> 4. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise: yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true Cannot retrieve metalink for repository: epel/x86_64. Please verify its path and try again

原因是安装完毕 epel-release 后, 会在 /etc/yum.repo.d/目录中添加 epel.repo 以及 epel-testing.repo 两个配置文件,配置文件中包含 container-selinux 的yum源。

解决方法:

  1. 继续同步epel.repo中指定的yum源,并修改本地/etc/yum.repo.d/epel.repo对应的yum源路径。
  2. 找一台可下载container-selinux相关rpm包的服务器下载关联安装包进行安装。

我目前是使用的第二种解决方案,在一台能上外网的机器中执行如下命令:

# 挂载位置轻喷 嘻嘻
sudo docker rum --rm -v /container-selinux:/data -it centos:latest /bin/bash -c "yum install -y epel-release && yum install container-selinux --downloadonly --downloaddir=/data"

然后将/container-selinux/ 中container-selinux*.rpm 拷贝到目标服务器中,执行rpm安装命令即可

sudo rpm -ivh container-selinux*.rpm

由于人也比较懒,所以安装docker-ce相关的内容时也不会去配置GPG公钥,安装的时候跳过即可

sudo yum install -y docker-ce docker-ce-cli containerd.io --nogpgcheck

最新文章

  1. [LeetCode] Best Time to Buy and Sell Stock II
  2. canvas初探3:画方画圆
  3. &lt;&lt;&lt; jquery简介、开头语法、在线开发手册
  4. gdo图形引擎中的旋转角
  5. OkHttp使用介绍
  6. 在cocos code ide的基础上构建自己的lua开发调试环境
  7. C#操作FTP, FTPHelper和SFTPHelper
  8. Linux内核学习笔记1——系统调用原理【转】
  9. 用委托、匿名函数、Lambda的方式输出符合要求的数
  10. Android 中 ListView 常用属性合集
  11. There is no getter for property named &#39;userSpAndSp&#39; in &#39;class com.uauth.beans.UserSpAndSp&#39;
  12. java.net.URLEncode编码 与 URLDecode解码问题
  13. ElasticSearch 5.0及head插件安装
  14. vue项目webpack打包后图片路径错误
  15. 使用java中replaceAll方法替换字符串中的反斜杠
  16. 电子数据识别软件ABBYY FineReader
  17. 一个PE文件的逆向分析
  18. “全栈2019”Java第四十一章:static关键字
  19. Many-to-many relationships in EF Core 2.0 – Part 1: The basics
  20. 【Hive五】Hive函数UDF

热门文章

  1. python合并多个txt文件
  2. docker部署vue前端
  3. python pillow 处理图片
  4. $.extend和$.fn.extend详解
  5. Java学习日记——基础篇(二)基本语法
  6. 2.线程--线程安全(synchronized)
  7. Linux 如何通过某一台服务器调用执行多台远程服务器上的脚本,结果显示在本地?
  8. 页面tr和td的的隐藏与显示
  9. start、就绪、运行状态的demo演示
  10. Ideal打war包和tomcat展示War包