Skip to content

Commit

Permalink
create: check RHEL subscription files before mounting, Fix #1146
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Di Maio <[email protected]>
  • Loading branch information
89luca89 committed Feb 1, 2024
1 parent 1024c91 commit dddefed
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions distrobox-create
Original file line number Diff line number Diff line change
Expand Up @@ -700,12 +700,17 @@ generate_command() {
#
# /run/secrets is a standard location for RHEL containers, that is being pointed by
# /etc/rhsm-host by default.
if [ -e /etc/rhsm ]; then
result_command="${result_command}
--volume /etc/pki/entitlement/:/run/secrets/etc-pki-entitlement:ro
--volume /etc/rhsm/:/run/secrets/rhsm:ro
--volume /etc/yum.repos.d/redhat.repo:/run/secrets/redhat.repo:ro"
fi
RHEL_SUBSCRIPTION_FILES="
/etc/pki/entitlement/:/run/secrets/etc-pki-entitlement:ro
/etc/rhsm/:/run/secrets/rhsm:ro
/etc/yum.repos.d/redhat.repo:/run/secrets/redhat.repo:ro
"
for rhel_file in ${RHEL_SUBSCRIPTION_FILES}; do
if [ -e "$(echo "${rhel_file}" | cut -d':' -f1)" ]; then
result_command="${result_command}
--volume ${rhel_file}"
fi
done

# If we have a home prefix to use,
# 1- override the HOME env variable
Expand Down

0 comments on commit dddefed

Please sign in to comment.