Faster build without separate SDK install
Before this change, only the MQ SDK was installed into the go-toolset image, for use at build time. The genmqpkg command could take around a minute.
This commit is contained in:
committed by
Arthur Barr
parent
d6ea28ee6b
commit
0e18f17dc9
@@ -30,12 +30,10 @@ ARG IMAGE_SOURCE="Not specified"
|
|||||||
ARG IMAGE_TAG="Not specified"
|
ARG IMAGE_TAG="Not specified"
|
||||||
ARG GO_WORKDIR
|
ARG GO_WORKDIR
|
||||||
USER 0
|
USER 0
|
||||||
COPY install-mq.sh /usr/local/bin/
|
WORKDIR /opt/mqm
|
||||||
# Install the MQ SDK
|
# Download and extract MQ files, to get the MQ client needed to compile.
|
||||||
RUN mkdir /opt/mqm \
|
# Only extract certain MQ files to make the build quicker
|
||||||
&& chmod a+x /usr/local/bin/install-mq.sh \
|
RUN curl --fail --location $MQ_URL | tar --extract --gunzip \
|
||||||
&& sleep 1 \
|
|
||||||
&& INSTALL_SDK=1 install-mq.sh \
|
|
||||||
&& chown -R 1001:root /opt/mqm/*
|
&& chown -R 1001:root /opt/mqm/*
|
||||||
WORKDIR $GO_WORKDIR/
|
WORKDIR $GO_WORKDIR/
|
||||||
COPY go.mod go.sum ./
|
COPY go.mod go.sum ./
|
||||||
|
|||||||
@@ -21,17 +21,11 @@ set -ex
|
|||||||
test -f /usr/bin/rpm && RPM=true || RPM=false
|
test -f /usr/bin/rpm && RPM=true || RPM=false
|
||||||
test -f /usr/bin/apt-get && UBUNTU=true || UBUNTU=false
|
test -f /usr/bin/apt-get && UBUNTU=true || UBUNTU=false
|
||||||
|
|
||||||
# Only install the SDK package as part of the build stage
|
|
||||||
INSTALL_SDK=${INSTALL_SDK:-0}
|
|
||||||
|
|
||||||
# Download and extract the MQ unzippable server
|
# Download and extract the MQ unzippable server
|
||||||
DIR_TMP=/tmp/mq
|
DIR_TMP=/tmp/mq
|
||||||
mkdir -p ${DIR_TMP}
|
mkdir -p ${DIR_TMP}
|
||||||
cd ${DIR_TMP}
|
cd ${DIR_TMP}
|
||||||
curl --fail --remote-name --location $MQ_URL
|
curl --fail --location $MQ_URL | tar --extract --gunzip
|
||||||
|
|
||||||
tar -xzf ./*.tar.gz
|
|
||||||
rm -f ./*.tar.gz
|
|
||||||
ls -la ${DIR_TMP}
|
ls -la ${DIR_TMP}
|
||||||
|
|
||||||
# Generate MQ package in INSTALLATION_DIR
|
# Generate MQ package in INSTALLATION_DIR
|
||||||
@@ -53,7 +47,7 @@ export genmqpkg_incmqxr=0
|
|||||||
export genmqpkg_incnls=1
|
export genmqpkg_incnls=1
|
||||||
export genmqpkg_incras=1
|
export genmqpkg_incras=1
|
||||||
export genmqpkg_incsamp=1
|
export genmqpkg_incsamp=1
|
||||||
export genmqpkg_incsdk=$INSTALL_SDK
|
export genmqpkg_incsdk=0
|
||||||
export genmqpkg_inctls=1
|
export genmqpkg_inctls=1
|
||||||
export genmqpkg_incunthrd=0
|
export genmqpkg_incunthrd=0
|
||||||
export genmqpkg_incweb=1
|
export genmqpkg_incweb=1
|
||||||
@@ -97,8 +91,8 @@ $RPM && PAM_FILE=/etc/pam.d/password-auth
|
|||||||
sed -i 's/password\t\[success=1 default=ignore\]\tpam_unix\.so obscure sha512/password\t[success=1 default=ignore]\tpam_unix.so obscure sha512 minlen=8/' $PAM_FILE
|
sed -i 's/password\t\[success=1 default=ignore\]\tpam_unix\.so obscure sha512/password\t[success=1 default=ignore]\tpam_unix.so obscure sha512 minlen=8/' $PAM_FILE
|
||||||
|
|
||||||
# List all the installed packages, for the build log
|
# List all the installed packages, for the build log
|
||||||
$RPM && rpm -q --all || true
|
$RPM && (rpm -q --all | sort) || true
|
||||||
$UBUNTU && dpkg --list || true
|
$UBUNTU && (dpkg --list | sort) || true
|
||||||
|
|
||||||
#Update the license file to include UBI 8 instead of UBI 7
|
#Update the license file to include UBI 8 instead of UBI 7
|
||||||
sed -i 's/v7.0/v8.0/g' /opt/mqm/licenses/non_ibm_license.txt
|
sed -i 's/v7.0/v8.0/g' /opt/mqm/licenses/non_ibm_license.txt
|
||||||
|
|||||||
Reference in New Issue
Block a user