Does a RHEL7 docker container need subscription?
Asked Answered
P

6

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

Papoose answered 5/12, 2016 at 12:56 Comment(0)
S
5

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.

Stutter answered 5/12, 2016 at 13:45 Comment(2)
The cloudgeekz.com link does not work anymoreGoudy
Here's the archived page: web.archive.org/web/20200925170954/http://cloudgeekz.com/625/…Habitude
I
3

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

Iorgos answered 9/5, 2019 at 17:53 Comment(3)
Can you use regular Docker with this or do you have to use 'podman'Kaiserslautern
Yes, you you can use the images with regular docker.Iorgos
If I don't use a subscription, I cannot find packages normally found in CodeReady repo.Wingback
W
1

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/

Wingback answered 10/3, 2021 at 16:56 Comment(0)
F
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.

Fettling answered 9/11, 2018 at 23:27 Comment(1)
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=<rhn-user> --password=<rhnpwd> --auto-attach. And unregister at end of build: RUN subscription-manager unregisterCome
J
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.

Junie answered 13/8, 2019 at 4:57 Comment(1)
You can hide the warning with: yum --disableplugin=subscription-managerWingback
A
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

Analphabetic answered 5/3, 2021 at 7:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.