2015-12-13 41 views
2

在Centos7.1碼頭工人主持人:我建立一個碼頭工人形象與Dockerfile有命令碼頭工人建立自己的錯誤有沒有啓用回購

RUN yum -y install deltarpm yum-utils --disablerepo=*-eus-* --disablerepo=*-htb-*  --disablerepo=*-ha-* --disablerepo=*-rt-* --disablerepo=*-lb-* --disablerepo=*-rs-* --disablerepo=*-sap-* 

在泊塢窗生成命令的運行: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?

(請注意,我可以安裝在碼頭工人的主機這些軟件包)

+0

什麼是你的基地形象? (Dockerfile中的FROM xxx) – VonC

回答

2

在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:

[[email protected] ~]# mkdir /media/rhel7-repo-iso 
[[email protected] ~]# mount /dev/cdrom /media/rhel7-repo-iso/ 
mount: /dev/sr0 is write-protected, mounting read-only 

不是由一個Dockerfile /泊塢窗圖像支持,雖然看到了手動解決。

您最好使用不需要任何訂閱模式的基本映像。例如:

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 
+0

我正在使用FROM rhel7:最新的 – iam

+0

@iam只需使用另一個基本映像。是否有任何特定的要求,這意味着你有*使用rhel7? – VonC

+0

是的,我正在處理此問題:https://access.redhat.com/documentation/en/red-hat-enterprise-linux-atomic-host/version-7/getting-started-guide/#install_and_deploy_an_apache_web_server_container – iam