distributions icon indicating copy to clipboard operation
distributions copied to clipboard

Add support for RedHat containers

Open faangbait opened this issue 2 years ago • 1 comments

Issue: Guidance from Red Hat for containerized development recommends images without yum installed.

From https://access.redhat.com/solutions/3144031:

The rhel-atomic / rhel7-atomic / rhel7/rhel-atomic container image uses microdnf instead of yum for package management. More information about using microdnf can be found in the Getting Started with Containers guide at: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux_atomic_host/7/html/getting_started_with_containers/using_red_hat_universal_base_images_standard_minimal_and_runtimes#add_software_to_a_running_ubi_container

Workaround: curl -fsSL https://rpm.nodesource.com/setup_16.x | sed 's/yum/microdnf/g' | bash -

Solution: Check which package manager exists on the system.

faangbait avatar Apr 01 '22 02:04 faangbait

The fix is quite easy:

  1. Define (global) variables (variable names might be changed):
# Note: We could even add a check for `dnf` and change the order of checks.
# Note: First existing program will be used.
PKG_MAN="$(command -v yum || command -v microdnf)"
PKG_MAN_NAME="$(basename "$PKG_MAN")"
  1. Change these stuff in rpm/setup*.sh files:
    • keep /etc/yum.repos.d as is;
    • replace all yum strings with $PKG_MAN_NAME;
    • replace all yum commands with $PKG_MAN.

Now, I could create a PR for this, however, I have no idea if it is enough to make these changes in rpm/src/_setup.sh?

Any guidance apreciated. Or anyone could fix this issue instead of me. :wink: :pray:

tukusejssirs avatar Aug 16 '22 12:08 tukusejssirs

This issue is resolved with our new repository. More information can be found here.

JesusPaz avatar Aug 29 '23 19:08 JesusPaz

@JesusPaz the link points to a non-existent page

mb-shorai avatar Feb 28 '24 13:02 mb-shorai