我正在尝试访问CentOS上的EPEL (v8,Dockerhub最新版本)。我遵循的似乎是推荐的方法,即安装epel-release。
Dockerfile
FROM centos
RUN yum update -y
RUN yum install -y epel-release但是,当我试图构建容器时,我会得到以下内容:
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发布于 2020-08-13 12:26:44
正如在服务器端的this post中所提到的,添加
assumeyes=1在……里面
/etc/yum.conf会给你你想要的。因此,对于Dockerfile,您可以添加:
RUN echo "assumeyes=1" >> /etc/yum.confhttps://stackoverflow.com/questions/59416014
复制相似问题