2017-04-24 175 views
0

我是Docker的新手。我創建了以下Dockerfile並運行它:Docker:在CentOS上安裝庫

從CentOS的:最新 ENV集裝箱碼頭工人 運行yum -y更新& &百勝清潔所有

我收到以下錯誤/輸出:

根@ GGNLABVM-JUPER6:〜/ docker_test#docker build -t test。

發送建立上下文碼頭工人守護2.048 KB

步驟1/3:從CentOS的:最新 ---> a8493f5f50ff

步驟2/3:ENV集裝箱碼頭工人 --->運行中e8e244c0c9d6 ---> 07355d554b3a 卸下中間容器e8e244c0c9d6

步驟3/3:運行yum -y更新& &蔭清潔所有 --->運行中68ad7f2 f86e2 加載的插件:最快鏡像,ovl

其中一個配置的存儲庫失敗(未知), 和yum沒有足夠的緩存數據繼續。在這一點上,唯一可以做的安全事情就是失敗。有幾種方法來變通「修理」這樣的:

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. Run the command with the repository temporarily disabled 
     yum --disablerepo=<repoid> ... 

4. Disable the repository permanently, 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> 
    or 
     subscription-manager repos --disable=<repoid> 

5. 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 

無法找到回購有效的baseURL時:基礎/ 7/x86_64的

我該如何解決這個問題?

僅供參考:我想爲我的應用程序安裝其他依賴於python的庫。

泊塢窗信息: 容器:25 運行:3 暫停:0 停止:22張 圖片:13 服務器版本:17.03.1-CE 存儲驅動程序:AUFS 根目錄:在/ var/lib中/泊塢窗/ AUFS 備份文件系統:extfs 迪爾斯:78 Dirperm1支持:真 記錄司機:JSON文件 CGROUP司機:cgroupfs 插件: 卷:本地 網絡:橋主macvlan空覆蓋 羣:我nactive 運行時:runc 默認運行:runc 二進制代碼init:搬運工,初始化 containerd版本:4ab9917febca54791c5f071a9d1f404867857fcc runc版本:54296cf40ad8143b62dbcaa1d90e520a2136ddfe 初始化版本:949e6fa 安全選項: AppArmor的 的Seccomp 簡介:默認 內核版本:4.4。 0-72-generic 操作系統:Ubuntu 16.04.1 LTS OSType:linux 架構:x86_64 CPU:1 總內存:3。859吉布 名稱:GGNLABVM-JUPER6 ID:KXDG:GL4E:MPNN:4LYS:UO6Z:RFEK:BI2H:MJSP:BIMJ:NASA:XAFR:CRN7 多克爾根目錄:在/ var/lib中/搬運工 調試模式(客戶端):假 調試模式(服務器):假 註冊地:https://index.docker.io/v1/ 警告:沒有交換限制支持 試驗:假 不安全註冊處: 127.0.0.0/8 現場還原啓用:假

Dockre版本: 客戶端: 版本:17.03.1-ce API版本:1.27 前往版本:go1.7.5 git的承諾:c6d412e 內置:星期一3月27日17點14分09秒2017年 OS /拱門:LINUX/AMD64

服務器: 版本:17.03.1-CE API版本:1.27(最低版本1.12) 轉到版本:go1.7.5 git的承諾:c6d412e 內置:星期一3月27日17點14分09秒2017年 OS /拱門:LINUX/AMD64 試驗:假

+0

你是否支持代理?對我來說,它似乎工作。 – lvthillo

回答

0

難道僅僅是一個問題泊塢窗?你可以用yum安裝其他回購項目嗎?如果不是它可能是一個網絡問題。還可以在這裏複製docker infodocker version的輸出嗎?

+0

沒有。沒有與百勝似乎工作。我閱讀了有關更改./etc/yum.repos.d/CentOS-Base.repo文件以取消註釋baseUrl的信息。這似乎也不起作用。我得到網絡超時: 加載的插件:fastestmirror,OVL 無法檢索鏡像列表http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=container錯誤是 12:超時在http://鏡像列表.centos.org /?release = 7&arch = x86_64&repo = os&infra = container:(28,'解決30546毫秒後超時') – Twix

+0

好吧,您的問題是第一行的網絡問題。首先檢查你是否有連接,並在網站上嘗試類似'curl'的東西。 – xFuture