首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >码头CentOS -添加EPEL

码头CentOS -添加EPEL
EN

Stack Overflow用户
提问于 2019-12-19 19:44:43
回答 1查看 2.4K关注 0票数 1

我正在尝试访问CentOS上的EPEL (v8,Dockerhub最新版本)。我遵循的似乎是推荐的方法,即安装epel-release

Dockerfile

代码语言:javascript
复制
FROM centos

RUN yum update -y
RUN yum install -y epel-release

但是,当我试图构建容器时,我会得到以下内容:

代码语言:javascript
复制
Sending build context to Docker daemon  2.048kB
Step 1/6 : FROM centos
latest: Pulling from library/centos
729ec3a6ada3: Pull complete 
Digest: sha256:f94c1d992c193b3dc09e297ffd54d8a4f1dc946c37cbeceb26d35ce1647f88d9
Status: Downloaded newer image for centos:latest
 ---> 0f3e07c0138f
Step 2/6 : LABEL maintainer="rremer@medallia.com"
 ---> Running in be2f7fef5052
Removing intermediate container be2f7fef5052
 ---> 2f81a5f48a09
Step 3/6 : RUN yum update -y
 ---> Running in 441eafae5dac
CentOS-8 - AppStream                            0.0  B/s |   0  B     00:20    
CentOS-8 - Base                                 0.0  B/s |   0  B     00:20    
CentOS-8 - Extras                               0.0  B/s |   0  B     00:20    
Failed to synchronize cache for repo 'AppStream', ignoring this repo.
Failed to synchronize cache for repo 'BaseOS', ignoring this repo.
Failed to synchronize cache for repo 'extras', ignoring this repo.
Dependencies resolved.
Nothing to do.
Complete!
Removing intermediate container 441eafae5dac
 ---> 9410b8dede8c
Step 4/6 : RUN yum install -y epel-release
 ---> Running in 0514401a6ea3
CentOS-8 - AppStream                            0.0  B/s |   0  B     00:20    
CentOS-8 - Base                                 0.0  B/s |   0  B     00:20    
CentOS-8 - Extras                               0.0  B/s |   0  B     00:20    
Failed to synchronize cache for repo 'AppStream', ignoring this repo.
Failed to synchronize cache for repo 'BaseOS', ignoring this repo.
Failed to synchronize cache for repo 'extras', ignoring this repo.
No match for argument: epel-release
Error: Unable to find a match
The command '/bin/sh -c yum install -y epel-release' returned a non-zero code: 1
EN

回答 1

Stack Overflow用户

发布于 2020-08-13 12:26:44

正如在服务器端的this post中所提到的,添加

代码语言:javascript
复制
assumeyes=1

在……里面

代码语言:javascript
复制
/etc/yum.conf

会给你你想要的。因此,对于Dockerfile,您可以添加:

代码语言:javascript
复制
RUN echo "assumeyes=1" >> /etc/yum.conf
票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59416014

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档