Docker 构建错误没有启用的回购
Docker build error There are no enabled repos
在 Centos7.1 Docker 主机上:我正在构建一个 docker 映像,其中 Docker 文件具有命令
RUN yum -y install deltarpm yum-utils --disablerepo=*-eus-* --disablerepo=*-htb-* --disablerepo=*-ha-* --disablerepo=*-rt-* --disablerepo=*-lb-* --disablerepo=*-rs-* --disablerepo=*-sap-*
在 docker 构建命令的 运行 期间:docker build -t <image>
,我得到错误:
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
There are no enabled repos.
Run "yum repolist all" to see the repos you have.
You can enable repos with yum-config-manager --enable <repo>
我该如何解决这个问题?我还需要在 docker 中启用 yum repo 吗?
(请注意,我可以在 Docker 主机中安装这些软件包)
在您的 Dockerfile 中使用 yum (the Yellowdog Updater, Modified) 与您的主机 CentOS 无关。
它与您的 Dockerfile (FROM xxx
) 使用的基础映像有关。
重要的错误消息是:
There are no enabled repos.
您可以在“RHEL 7 - Solution to "There are no enabled repos" message”中看到手动解决方案
If you simply want to play around and install software without the need for up to date Red Hat subscription you can mount your downloaded redhat ISO image and make it your default local repository and be able to install software.
To enable your local repository and thus overcome the There are no enabled repos
, first mount your REHL7 iso image:
[root@rhel7 ~]# mkdir /media/rhel7-repo-iso
[root@rhel7 ~]# mount /dev/cdrom /media/rhel7-repo-iso/
mount: /dev/sr0 is write-protected, mounting read-only
不过 Dockerfile/docker 图片不支持。
您最好使用不需要任何订阅模式的基本映像。例如:
FROM fedora
RUN yum update -y
RUN yum install -y httpd
再次声明,这与您的主机无关。
OP 提到以下 Red Hat Enterprise Linux Atomic Host 7 Getting Started Guide
该指南明确包括:
To enable software updates, you must register your Red Hat Enterprise Linux Atomic Host installation.
This is done with the subscription-manager
command as described below.
If your system is located on a network that requires the use of an HTTP proxy, please see the Red Hat Knowledge Base Article on configuring subscription manager to use an HTTP proxy. The --name=
option may be included if you wish to provide an easy to remember name to be used when reviewing subscription records.
$ sudo subscription-manager register --username=<username> --auto-attach
在 Centos7.1 Docker 主机上:我正在构建一个 docker 映像,其中 Docker 文件具有命令
RUN yum -y install deltarpm yum-utils --disablerepo=*-eus-* --disablerepo=*-htb-* --disablerepo=*-ha-* --disablerepo=*-rt-* --disablerepo=*-lb-* --disablerepo=*-rs-* --disablerepo=*-sap-*
在 docker 构建命令的 运行 期间:docker build -t <image>
,我得到错误:
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
There are no enabled repos.
Run "yum repolist all" to see the repos you have.
You can enable repos with yum-config-manager --enable <repo>
我该如何解决这个问题?我还需要在 docker 中启用 yum repo 吗?
(请注意,我可以在 Docker 主机中安装这些软件包)
在您的 Dockerfile 中使用 yum (the Yellowdog Updater, Modified) 与您的主机 CentOS 无关。
它与您的 Dockerfile (FROM xxx
) 使用的基础映像有关。
重要的错误消息是:
There are no enabled repos.
您可以在“RHEL 7 - Solution to "There are no enabled repos" message”中看到手动解决方案
If you simply want to play around and install software without the need for up to date Red Hat subscription you can mount your downloaded redhat ISO image and make it your default local repository and be able to install software.
To enable your local repository and thus overcome theThere are no enabled repos
, first mount your REHL7 iso image:
[root@rhel7 ~]# mkdir /media/rhel7-repo-iso
[root@rhel7 ~]# mount /dev/cdrom /media/rhel7-repo-iso/
mount: /dev/sr0 is write-protected, mounting read-only
不过 Dockerfile/docker 图片不支持。
您最好使用不需要任何订阅模式的基本映像。例如:
FROM fedora
RUN yum update -y
RUN yum install -y httpd
再次声明,这与您的主机无关。
OP 提到以下 Red Hat Enterprise Linux Atomic Host 7 Getting Started Guide
该指南明确包括:
To enable software updates, you must register your Red Hat Enterprise Linux Atomic Host installation.
This is done with thesubscription-manager
command as described below.
If your system is located on a network that requires the use of an HTTP proxy, please see the Red Hat Knowledge Base Article on configuring subscription manager to use an HTTP proxy. The--name=
option may be included if you wish to provide an easy to remember name to be used when reviewing subscription records.
$ sudo subscription-manager register --username=<username> --auto-attach