Fix for building on subscribed and unsubscribed hosts
This commit is contained in:
@@ -41,5 +41,6 @@ podman run \
|
|||||||
--env MQDEV=${dev} \
|
--env MQDEV=${dev} \
|
||||||
--user $(id -u) \
|
--user $(id -u) \
|
||||||
--rm \
|
--rm \
|
||||||
|
--network podman \
|
||||||
${tag} \
|
${tag} \
|
||||||
bash -c "cd /opt/app-root/src/go/src/github.com/ibm-messaging/mq-container/ && ./mq-advanced-server-rhel/go-build.sh"
|
bash -c "cd /opt/app-root/src/go/src/github.com/ibm-messaging/mq-container/ && ./mq-advanced-server-rhel/go-build.sh"
|
||||||
|
|||||||
@@ -61,10 +61,18 @@ readonly mqdev=$5
|
|||||||
# Install MQ server
|
# Install MQ server
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
# Use the Yum repositories configured on the host
|
microdnf_opts="--nodocs"
|
||||||
cp -R /etc/yum.repos.d/* ${mnt_mq}/etc/yum.repos.d/
|
# Check whether the host is registered with Red Hat
|
||||||
# Install the packages required by MQ
|
subscription-manager status
|
||||||
yum install -y --installroot=${mnt_mq} --setopt install_weak_deps=false --setopt=tsflags=nodocs --setopt=override_install_langs=en_US.utf8 \
|
if [ "$?" -eq "0" ]; then
|
||||||
|
# Host is subscribed, but the minimal image has no enabled repos
|
||||||
|
microdnf_opts="${microdnf_opts} --enablerepo=rhel-7-server-rpms"
|
||||||
|
# buildah run ${ctr_mq} -- microdnf microdnf --enablerepo=rhel-7-server-rpms --nodocs install ${prereq_packages}
|
||||||
|
else
|
||||||
|
# Use the Yum repositories configured on the host
|
||||||
|
cp -R /etc/yum.repos.d/* ${mnt_mq}/etc/yum.repos.d/
|
||||||
|
fi
|
||||||
|
buildah run ${ctr_mq} -- microdnf ${microdnf_opts} install \
|
||||||
bash \
|
bash \
|
||||||
bc \
|
bc \
|
||||||
coreutils \
|
coreutils \
|
||||||
@@ -81,16 +89,15 @@ yum install -y --installroot=${mnt_mq} --setopt install_weak_deps=false --setopt
|
|||||||
util-linux \
|
util-linux \
|
||||||
which
|
which
|
||||||
|
|
||||||
|
# Clean up cached files
|
||||||
|
buildah run ${ctr_mq} -- microdnf ${microdnf_opts} clean all
|
||||||
|
rm -rf ${mnt_mq}/etc/yum.repos.d/*
|
||||||
|
|
||||||
groupadd --root ${mnt_mq} --system --gid 888 mqm
|
groupadd --root ${mnt_mq} --system --gid 888 mqm
|
||||||
useradd --root ${mnt_mq} --system --uid 888 --gid mqm mqm
|
useradd --root ${mnt_mq} --system --uid 888 --gid mqm mqm
|
||||||
usermod --root ${mnt_mq} -aG root mqm
|
usermod --root ${mnt_mq} -aG root mqm
|
||||||
usermod --root ${mnt_mq} -aG mqm root
|
usermod --root ${mnt_mq} -aG mqm root
|
||||||
|
|
||||||
# Clean up cached files
|
|
||||||
yum clean --installroot=${mnt_mq} all
|
|
||||||
rm -rf ${mnt_mq}/var/cache/yum/*
|
|
||||||
rm -rf ${mnt_mq}/etc/yum.repos.d/*
|
|
||||||
|
|
||||||
# Install MQ server packages into the MQ builder image
|
# Install MQ server packages into the MQ builder image
|
||||||
./mq-advanced-server-rhel/install-mq-rhel.sh ${ctr_mq} "${mnt_mq}" "${archive}" "${packages}"
|
./mq-advanced-server-rhel/install-mq-rhel.sh ${ctr_mq} "${mnt_mq}" "${archive}" "${packages}"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user