Run RHEL8 on docker with Red Hat UBI image

Posted under tech On By xpk

Red Hat is offering a few official docker images for RHEL8. One can now use or build images based on the latest operating system from Red Hat. Here is how to do it in 3 simple steps

Step 1: Create a dockerfile

USER root
LABEL maintainer="John Doe"
# Disable RHSM
RUN sed -i -e  's/^\(enabled\).*/\1=0/g' /etc/yum/pluginconf.d/subscription-manager.conf
# Start bash
ENTRYPOINT ["/usr/bin/bash"]

Step 2: Build an image

▶ docker build -t rhel8-ubi .

Step 3: Run the image

▶ docker run -it --name rhel8 3e7fc515a894
 bash-4.4# cat /etc/redhat-release 
 Red Hat Enterprise Linux release 8.0 (Ootpa)

The UBI images get packages from the UBI yum repositories. They do not contain all packages like a full-blown OS. To learn more about the UBI images, please go to this link.

 1,588 total views,  2 views today