distributions
distributions copied to clipboard
Add support for RedHat containers
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.
The fix is quite easy:
- 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")"
- 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
.
- keep
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:
This issue is resolved with our new repository. More information can be found here.
@JesusPaz the link points to a non-existent page