10

I have a rhel7 host with docker in it. I have build a image with also rhel7 as base image. But when I run the container & do yum update or try to install in package with yum, it gives me below error.

"This system is not registered to Red Hat Subscription.you can use subscription manager to register"

I have already subscribed the host RHEL Machine. Do I need to subscribe each and every container with rhel image?

Or

Do I need to subscribe in the dockerfile itself while building the image?

Thanks

Alejandro Galera
  • 3,445
  • 3
  • 24
  • 42
Furious
  • 473
  • 2
  • 5
  • 21

6 Answers6

4

On the Docker hub, you can find some Red Hat docker images , like

https://hub.docker.com/r/richxsl/rhel6.5/

or

https://hub.docker.com/r/lionelman45/rhel7/

but in order to update them, you will need a valid subscription

You will find Red Hat docker images on the Red Hat site, at

https://access.redhat.com/containers

this article summarizes what you need in order to build a Red hat docker image

http://cloudgeekz.com/625/howto-create-a-docker-image-for-rhel.html

it begins with

Pre-requisites Access to RHEL package repository.

user2915097
  • 30,758
  • 6
  • 57
  • 59
3

With RHEL 8 Red Hat now offers a universal base image for docker containers which does not require a subscription.

Florian Feldhaus
  • 5,567
  • 2
  • 38
  • 46
0

The RHEL 7 documentation covers this. Please use your subscription to read section 1.4.

Paraphrasing what the documentation says:

  • You must use a subscribed RHEL 7 host to build containers
  • Containers based on RHEL 7 will use the host's subscription automatically and be able to access the RHEL 7 yum repositories

If you are trying to build RHEL 7 based containers on a properly subscribed RHEL 7 host and it doesn't work, you might be running into a bug. I would contact support to try and sort this out.

omajid
  • 14,165
  • 4
  • 47
  • 64
  • I found that registration was required when trying to build a rhel based container using 'docker build', but not necessary when using 'podman build'. If using docker build, the registration can be done in Docker file by adding extra RUN steps `RUN subscription-manager register --username= --password= --auto-attach`. And unregister at end of build: `RUN subscription-manager unregister` – tonioc Feb 16 '21 at 16:45
0

I used podman to pull RHEL 7 Universal Base Image, like this:

podman pull registry.access.redhat.com/ubi7/ubi

After that, although I still saw the warning message:

This system is not registered with an entitlement server. You can use subscription-manager to register.

but there was no issue to use yum for package installation or update.

You can also use RHEL8 ubi in the same approach without any issue.

0

I found this article that clarifies the RHEL UBI images which do not need a subscription. https://developers.redhat.com/blog/2020/03/24/red-hat-universal-base-images-for-docker-users/

docker search registry.access.redhat.com/ubi
docker run -it --name test registry.access.redhat.com/ubi8/ubi:8.1 bash

I tried yum to install a netcat command which worked seamlessly

pythondev
  • 9
  • 3
0

The RHEL UBI image contains 3 default repos (see yum repolist). Subscription is required for the CodeReady repo (ubi-8-codeready-builder).

If you decide to NOT subscribe then you can hide those warnings with:

yum --disableplugin=subscription-manager install <package>

Source: https://developers.redhat.com/blog/2020/03/24/red-hat-universal-base-images-for-docker-users/

jersey bean
  • 3,321
  • 4
  • 28
  • 43