What is the official way to add additional repos to RHEL containers in Atomic
Greetings!
I am looking at adding in a few additional repos into my containers on an Atomic Host server. I notice that within the containers subscription-manager is disabled. What is the official method to add these? Unless I missed something, adding them to the Atomic host via subscription-manager didn't work. I figure before I waste too much time, to just ask. The first container that I know would need an additional repo is one that would require Oracle Java for getting any customer support for.
Thanks for all who spend a microsecond pondering this,
Andrew.
Some copied output from the ssh session, to more accurately show my dilemma in case it wasn't perfectly clear.
-bash-4.2# subscription-manager repos --list | grep -B3 'Enabled: 1'
Repo ID: rhel-7-server-eus-rh-common-rpms
Repo Name: Red Hat Enterprise Linux 7 Server - Extended Update Support - RH Common (RPMs)
Repo URL: https://cdn.redhat.com/content/eus/rhel/server/7/$releasever/$basearch/rh-common/os
Enabled: 1
--
Repo ID: rhel-rs-for-rhel-7-server-eus-rpms
Repo Name: Red Hat Enterprise Linux Resilient Storage (for RHEL 7 Server) - Extended Update Support (RPMs)
Repo URL: https://cdn.redhat.com/content/eus/rhel/server/7/$releasever/$basearch/resilientstorage/os
Enabled: 1
--
Repo ID: rhel-7-server-extras-rpms
Repo Name: Red Hat Enterprise Linux 7 Server - Extras (RPMs)
Repo URL: https://cdn.redhat.com/content/dist/rhel/server/7/7Server/$basearch/extras/os
Enabled: 1
--
Repo ID: rhel-ha-for-rhel-7-server-eus-rpms
Repo Name: Red Hat Enterprise Linux High Availability (for RHEL 7 Server) - Extended Update Support (RPMs)
Repo URL: https://cdn.redhat.com/content/eus/rhel/server/7/$releasever/$basearch/highavailability/os
Enabled: 1
--
Repo ID: rhel-7-server-thirdparty-oracle-java-source-rpms
Repo Name: Red Hat Enterprise Linux 7 Server - Oracle Java (Source RPMs)
Repo URL: https://cdn.redhat.com/content/dist/rhel/server/7/$releasever/$basearch/oracle-java/source/SRPMS
Enabled: 1
--
Repo ID: rhel-7-server-eus-rpms
Repo Name: Red Hat Enterprise Linux 7 Server - Extended Update Support (RPMs)
Repo URL: https://cdn.redhat.com/content/eus/rhel/server/7/$releasever/$basearch/os
Enabled: 1
--
Repo ID: rhel-7-server-thirdparty-oracle-java-rpms
Repo Name: Red Hat Enterprise Linux 7 Server - Oracle Java (RPMs)
Repo URL: https://cdn.redhat.com/content/dist/rhel/server/7/$releasever/$basearch/oracle-java/os
Enabled: 1
--
Repo ID: rhel-rs-for-rhel-7-server-rpms
Repo Name: Red Hat Enterprise Linux Resilient Storage (for RHEL 7 Server) (RPMs)
Repo URL: https://cdn.redhat.com/content/dist/rhel/server/7/$releasever/$basearch/resilientstorage/os
Enabled: 1
--
Repo ID: rhel-ha-for-rhel-7-server-rpms
Repo Name: Red Hat Enterprise Linux High Availability (for RHEL 7 Server) (RPMs)
Repo URL: https://cdn.redhat.com/content/dist/rhel/server/7/$releasever/$basearch/highavailability/os
Enabled: 1
--
Repo ID: rhel-7-server-rpms
Repo Name: Red Hat Enterprise Linux 7 Server (RPMs)
Repo URL: https://cdn.redhat.com/content/dist/rhel/server/7/$releasever/$basearch/os
Enabled: 1
--
Repo ID: rhel-7-server-supplementary-rpms
Repo Name: Red Hat Enterprise Linux 7 Server - Supplementary (RPMs)
Repo URL: https://cdn.redhat.com/content/dist/rhel/server/7/$releasever/$basearch/supplementary/os
Enabled: 1
--
Repo ID: rhel-7-server-optional-rpms
Repo Name: Red Hat Enterprise Linux 7 Server - Optional (RPMs)
Repo URL: https://cdn.redhat.com/content/dist/rhel/server/7/$releasever/$basearch/optional/os
Enabled: 1
[root@b309d73cee15 /]# subscription-manager repos --list
subscription-manager is disabled when running inside a container. Please refer to your host system for subscription management.
[root@b309d73cee15 /]# yum repolist
Loaded plugins: product-id, subscription-manager
repo id repo name status
rhel-7-server-eus-rpms/7Server/x86_64 Red Hat Enterprise Linux 7 Server - Extended Update Support (RPMs) 5509
rhel-7-server-rpms/7Server/x86_64 Red Hat Enterprise Linux 7 Server (RPMs) 6812
rhel-7-server-rt-beta-rpms/x86_64 Red Hat Enterprise Linux for Real Time Beta (RHEL 7 Server) (RPMs) 14
rhel-ha-for-rhel-7-server-eus-rpms/7Server/x86_64 Red Hat Enterprise Linux High Availability (for RHEL 7 Server) - Extended Update Support (RPMs) 82
rhel-ha-for-rhel-7-server-rpms/7Server/x86_64 Red Hat Enterprise Linux High Availability (for RHEL 7 Server) (RPMs) 106
rhel-rs-for-rhel-7-server-eus-rpms/7Server/x86_64 Red Hat Enterprise Linux Resilient Storage (for RHEL 7 Server) - Extended Update Support (RPMs) 93
rhel-rs-for-rhel-7-server-rpms/7Server/x86_64 Red Hat Enterprise Linux Resilient Storage (for RHEL 7 Server) (RPMs) 124
repolist: 12740
[root@b309d73cee15 /]#
Responses
Hello Andrew,
For containers you can use yum-config-manager to enable or disable repos, like so:
# yum-config-manager --disable rhel-7-server-eus-rpms
or
# yum-config-manager --enable rhel-7-server-eus-rpms
Note that yum-config-manager is from the yum-utils package, so to first install it you'd want to run this:
# yum --disablerepo=* --enablerepo=rhel-7-server-rpms install yum-utils
If you wanted to disable all the EUS, RT, HTB and HA repos you could use this:
# yum-config-manager --disable \*-htb-* \*-rt-* \*-eus* \*-ha-*
# yum repolist enabled
See also https://access.redhat.com/solutions/1314663
A workaround if yum-config-manager is not available, is to manually edit /etc/yum.repos.d/redhat.repo
Thank you, I've resolved using the following solution --> https://access.redhat.com/solutions/1443553
cat Dockerfile
# RHEL7 Container #
FROM rhel7:latest
# File Author / Maintainer
MAINTAINER ME - me@domain.com
RUN yum repolist all && \
yum-config-manager --enable rhel-7-server-satellite-capsule-6.2-rpms && \
yum makecache && \
yum install satellite-capsule -y && \
yum clean all && \
rm -rf /var/cache/yum/*
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
