Fix dev image uid and build off rhel7
This commit is contained in:
@@ -30,5 +30,6 @@ podman run \
|
|||||||
--env IMAGE_REVISION="$IMAGE_REVISION" \
|
--env IMAGE_REVISION="$IMAGE_REVISION" \
|
||||||
--env IMAGE_SOURCE="$IMAGE_SOURCE" \
|
--env IMAGE_SOURCE="$IMAGE_SOURCE" \
|
||||||
--env MQDEV=${dev} \
|
--env MQDEV=${dev} \
|
||||||
|
--rm \
|
||||||
${tag} \
|
${tag} \
|
||||||
bash -c "cd /go/src/github.com/ibm-messaging/mq-container/ && ./mq-advanced-server-rhel/go-build.sh"
|
bash -c "cd /go/src/github.com/ibm-messaging/mq-container/ && ./mq-advanced-server-rhel/go-build.sh"
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ set -e
|
|||||||
|
|
||||||
# Use a "scratch" container, so the resulting image has minimal files
|
# Use a "scratch" container, so the resulting image has minimal files
|
||||||
# Resulting image won't have yum, for example
|
# Resulting image won't have yum, for example
|
||||||
readonly ctr_mq=$(buildah from scratch)
|
readonly ctr_mq=$(buildah from rhel7)
|
||||||
readonly mnt_mq=$(buildah mount $ctr_mq)
|
readonly mnt_mq=$(buildah mount $ctr_mq)
|
||||||
readonly archive=downloads/$1
|
readonly archive=downloads/$1
|
||||||
readonly packages=$2
|
readonly packages=$2
|
||||||
@@ -36,18 +36,12 @@ readonly tag=$3
|
|||||||
readonly version=$4
|
readonly version=$4
|
||||||
readonly mqdev=$5
|
readonly mqdev=$5
|
||||||
|
|
||||||
# Initialize yum for use with the scratch container
|
|
||||||
rpm --root $mnt_mq --initdb
|
|
||||||
|
|
||||||
yumdownloader --destdir=/tmp redhat-release-server
|
|
||||||
rpm --root $mnt_mq -ihv /tmp/redhat-release-server*.rpm || true
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Install MQ server
|
# Install MQ server
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
# Install the packages required by MQ
|
# Install the packages required by MQ
|
||||||
yum install -y --installroot=${mnt_mq} --setopt install_weak_deps=false --setopt=tsflags=nodocs --setopt=override_install_langs=en_US.utf8 \
|
buildah run $ctr_mq -- yum install -y --setopt install_weak_deps=false --setopt=tsflags=nodocs --setopt=override_install_langs=en_US.utf8 \
|
||||||
bash \
|
bash \
|
||||||
bc \
|
bc \
|
||||||
coreutils \
|
coreutils \
|
||||||
@@ -63,7 +57,7 @@ yum install -y --installroot=${mnt_mq} --setopt install_weak_deps=false --setopt
|
|||||||
util-linux
|
util-linux
|
||||||
|
|
||||||
# Clean up cached files
|
# Clean up cached files
|
||||||
yum clean all --installroot=${mnt_mq}
|
buildah run $ctr_mq -- yum clean all
|
||||||
rm -rf ${mnt_mq}/var/cache/yum/*
|
rm -rf ${mnt_mq}/var/cache/yum/*
|
||||||
|
|
||||||
# Install MQ server packages into the MQ builder image
|
# Install MQ server packages into the MQ builder image
|
||||||
@@ -110,3 +104,5 @@ buildah config \
|
|||||||
$ctr_mq
|
$ctr_mq
|
||||||
buildah unmount $ctr_mq
|
buildah unmount $ctr_mq
|
||||||
buildah commit $ctr_mq $tag
|
buildah commit $ctr_mq $tag
|
||||||
|
|
||||||
|
buildah rm $ctr_mq
|
||||||
|
|||||||
@@ -43,3 +43,5 @@ buildah config \
|
|||||||
--env CGO_LDFLAGS_ALLOW="-Wl,-rpath.*" \
|
--env CGO_LDFLAGS_ALLOW="-Wl,-rpath.*" \
|
||||||
${ctr}
|
${ctr}
|
||||||
buildah commit ${ctr} ${tag}
|
buildah commit ${ctr} ${tag}
|
||||||
|
|
||||||
|
buildah rm ${ctr}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ readonly version=$3
|
|||||||
|
|
||||||
useradd --root $mnt_mq --system --uid 889 --gid mqm admin
|
useradd --root $mnt_mq --system --uid 889 --gid mqm admin
|
||||||
groupadd --root $mnt_mq --system --gid 890 mqclient
|
groupadd --root $mnt_mq --system --gid 890 mqclient
|
||||||
useradd --root $mnt_mq --system --uid 890 --gid mqclient mqclient
|
useradd --root $mnt_mq --system --uid 890 --gid app mqclient
|
||||||
|
|
||||||
buildah run $ctr -- echo admin:passw0rd | chpasswd
|
buildah run $ctr -- echo admin:passw0rd | chpasswd
|
||||||
|
|
||||||
@@ -79,3 +79,4 @@ buildah config \
|
|||||||
buildah unmount $ctr_mq
|
buildah unmount $ctr_mq
|
||||||
buildah commit $ctr_mq $tag
|
buildah commit $ctr_mq $tag
|
||||||
|
|
||||||
|
buildah rm $ctr_mq
|
||||||
|
|||||||
@@ -22,17 +22,11 @@ set -e
|
|||||||
|
|
||||||
# Use a "scratch" container, so the resulting image has minimal files
|
# Use a "scratch" container, so the resulting image has minimal files
|
||||||
# Resulting image won't have yum, for example
|
# Resulting image won't have yum, for example
|
||||||
readonly ctr_mq=$(buildah from scratch)
|
readonly ctr_mq=$(buildah from rhel7)
|
||||||
readonly mnt_mq=$(buildah mount $ctr_mq)
|
readonly mnt_mq=$(buildah mount $ctr_mq)
|
||||||
readonly imagename=$1
|
readonly imagename=$1
|
||||||
|
|
||||||
# Initialize yum for use with the scratch container
|
buildah run $ctr_mq -- yum install -y \
|
||||||
rpm --root $mnt_mq --initdb
|
|
||||||
|
|
||||||
yumdownloader --destdir=/tmp redhat-release-server
|
|
||||||
rpm --root $mnt_mq -ihv /tmp/redhat-release-server*.rpm || true
|
|
||||||
|
|
||||||
yum --installroot $mnt_mq install -y \
|
|
||||||
java-1.7.0-openjdk-devel \
|
java-1.7.0-openjdk-devel \
|
||||||
java \
|
java \
|
||||||
which \
|
which \
|
||||||
@@ -59,9 +53,13 @@ cp $mnt_mq/usr/src/mymaven/target/lib/*.jar $mnt_mq/opt/app/
|
|||||||
rm -rf $mnt_mq/tmp/*
|
rm -rf $mnt_mq/tmp/*
|
||||||
rm -rf $mnt_mq/usr/src/mymaven
|
rm -rf $mnt_mq/usr/src/mymaven
|
||||||
|
|
||||||
# We can't uninstall tar or gzip because
|
# We can't uninstall tar or gzip because they are required
|
||||||
yum --installroot $mnt_mq remove -y \
|
buildah run $ctr_mq -- yum remove -y \
|
||||||
wget
|
wget
|
||||||
|
|
||||||
|
# Clean up cached files
|
||||||
|
buildah run $ctr_mq -- yum clean all
|
||||||
|
rm -rf ${mnt_mq}/var/cache/yum/*
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Contain image finalization
|
# Contain image finalization
|
||||||
|
|||||||
Reference in New Issue
Block a user