From 84bf601d7d834b3a9715ed572e82047a718ef44b Mon Sep 17 00:00:00 2001 From: Kirby Chin <37311900+kabicin@users.noreply.github.com> Date: Mon, 5 Jan 2026 17:36:30 -0500 Subject: [PATCH 1/2] Install ifixes in features.sh --- README.md | 8 ++++---- ga/latest/kernel/helpers/build/configure.sh | 15 ++++++++------- ga/latest/kernel/helpers/build/features.sh | 9 +++++++-- .../helpers/build/infinispan-client-setup.sh | 4 ++-- .../helpers/build/internal/features-installed.sh | 13 +++++++++++++ .../build/internal/{logger.sh => utils.sh} | 15 ++++++++++++++- ga/latest/kernel/helpers/build/populate_scc.sh | 4 ++-- 7 files changed, 50 insertions(+), 18 deletions(-) rename ga/latest/kernel/helpers/build/internal/{logger.sh => utils.sh} (60%) diff --git a/README.md b/README.md index c8cfde45..141ecd60 100644 --- a/README.md +++ b/README.md @@ -40,16 +40,16 @@ COPY --chown=1001:0 server.xml /config/ # A sample is in the 'Getting Required Features' section below COPY --chown=1001:0 featureUtility.properties /opt/ibm/wlp/etc/ -# This script will add the requested XML snippets to enable Liberty features and grow the image to be fit-for-purpose using featureUtility. -RUN features.sh - # Add interim fixes (optional) COPY --chown=1001:0 interim-fixes /opt/ibm/fixes/ +# This script will add the requested XML snippets to enable Liberty features, grow the image to be fit-for-purpose using featureUtility and apply any interim fixes. +RUN features.sh + # Add application COPY --chown=1001:0 Sample1.war /config/dropins/ -# This script will add the requested server configurations, apply any interim fixes and populate caches to optimize runtime +# This script will add the requested server configurations and populate caches to optimize runtime RUN configure.sh ``` diff --git a/ga/latest/kernel/helpers/build/configure.sh b/ga/latest/kernel/helpers/build/configure.sh index 77f0c769..634abee0 100755 --- a/ga/latest/kernel/helpers/build/configure.sh +++ b/ga/latest/kernel/helpers/build/configure.sh @@ -1,5 +1,5 @@ #!/bin/bash -# (C) Copyright IBM Corporation 2020, 2025. +# (C) Copyright IBM Corporation 2020, 2026. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ else FEATURES_INSTALLED=false fi -. /opt/ibm/helpers/build/internal/logger.sh +. /opt/ibm/helpers/build/internal/utils.sh set -Eeox pipefail @@ -150,10 +150,6 @@ function main() { fi fi - # Apply interim fixes found in /opt/ibm/fixes - # Fixes recommended by IBM, such as to resolve security vulnerabilities, are also included in /opt/ibm/fixes - # Note: This step should be done once needed features are enabled and installed using installUtility. - # Do not create a SCC if [ -n "${IBM_JAVA_OPTIONS}" ]; then IBM_JAVA_OPTIONS="${IBM_JAVA_OPTIONS} -Xshareclasses:none" @@ -163,7 +159,10 @@ function main() { OPENJ9_JAVA_OPTIONS="${OPENJ9_JAVA_OPTIONS} -Xshareclasses:none" fi - find /opt/ibm/fixes -type f -name "*.jar" -print0 | sort -z | xargs -0 -n 1 -r -I {} java -jar {} --installLocation $WLP_INSTALL_DIR + # Apply interim fixes found in /opt/ibm/fixes + # Fixes recommended by IBM, such as to resolve security vulnerabilities, are also included in /opt/ibm/fixes + # Note: This step should only be done ONCE needed features are enabled and installed. + installFixes #Make sure that group write permissions are set correctly after installing new features find /opt/ibm/wlp ! -perm -g=rw -print0 | xargs -r -0 chmod g+rw @@ -193,6 +192,8 @@ function main() { fi eval $cmd fi + + removeBuildArtifacts } ## parse provider list to generate files into configDropins diff --git a/ga/latest/kernel/helpers/build/features.sh b/ga/latest/kernel/helpers/build/features.sh index a9469b85..efbcf0a2 100755 --- a/ga/latest/kernel/helpers/build/features.sh +++ b/ga/latest/kernel/helpers/build/features.sh @@ -1,5 +1,5 @@ #!/bin/bash -# (C) Copyright IBM Corporation 2023, 2025. +# (C) Copyright IBM Corporation 2023, 2026. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -. /opt/ibm/helpers/build/internal/logger.sh +. /opt/ibm/helpers/build/internal/utils.sh set -Eeox pipefail @@ -43,4 +43,9 @@ fi featureUtility installServerFeatures --acceptLicense defaultServer --noCache find /opt/ibm/wlp/lib /opt/ibm/wlp/bin ! -perm -g=rw -print0 | xargs -0 -r chmod g+rw +# Apply interim fixes found in /opt/ibm/fixes +# Fixes recommended by IBM, such as to resolve security vulnerabilities, are also included in /opt/ibm/fixes +# Note: This step should only be done ONCE needed features are enabled and installed. +installFixes + echo "features.sh script has been run" > /logs/features.log diff --git a/ga/latest/kernel/helpers/build/infinispan-client-setup.sh b/ga/latest/kernel/helpers/build/infinispan-client-setup.sh index ca8a36f4..65c5f96c 100755 --- a/ga/latest/kernel/helpers/build/infinispan-client-setup.sh +++ b/ga/latest/kernel/helpers/build/infinispan-client-setup.sh @@ -1,5 +1,5 @@ #!/bin/bash -# (C) Copyright IBM Corporation 2020, 2025. +# (C) Copyright IBM Corporation 2020, 2026. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -. /opt/ibm/helpers/build/internal/logger.sh +. /opt/ibm/helpers/build/internal/utils.sh set -Eeox pipefail diff --git a/ga/latest/kernel/helpers/build/internal/features-installed.sh b/ga/latest/kernel/helpers/build/internal/features-installed.sh index c32ac59f..e311862a 100755 --- a/ga/latest/kernel/helpers/build/internal/features-installed.sh +++ b/ga/latest/kernel/helpers/build/internal/features-installed.sh @@ -1,4 +1,17 @@ #!/bin/bash +# (C) Copyright IBM Corporation 2025, 2026. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. if [ -f "/logs/features.log" ]; then rm /logs/features.log diff --git a/ga/latest/kernel/helpers/build/internal/logger.sh b/ga/latest/kernel/helpers/build/internal/utils.sh similarity index 60% rename from ga/latest/kernel/helpers/build/internal/logger.sh rename to ga/latest/kernel/helpers/build/internal/utils.sh index a4fd59ca..e36c9fd8 100755 --- a/ga/latest/kernel/helpers/build/internal/logger.sh +++ b/ga/latest/kernel/helpers/build/internal/utils.sh @@ -1,5 +1,5 @@ #!/bin/bash -# (C) Copyright IBM Corporation 2025. +# (C) Copyright IBM Corporation 2025, 2026. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ # limitations under the License. function main() { + WLP_TYPE=ibm + WLP_INSTALL_DIR=/opt/$WLP_TYPE/wlp if [ "$VERBOSE" != "true" ]; then exec >/dev/null fi @@ -27,4 +29,15 @@ function showLogs() { exec 1>&3 3>&- 2>&4 4>&- } +function installFixes() { + if [ ! -f "/logs/fixes.log" ] && ls "/opt/$WLP_TYPE/fixes"/*.jar 1> /dev/null 2>&1; then + find /opt/$WLP_TYPE/fixes -type f -name "*.jar" -print0 | sort -z | xargs -0 -n 1 -r -I {} java -jar {} --installLocation $WLP_INSTALL_DIR + echo "installFixes has been run" > /logs/fixes.log + fi +} + +function removeBuildArtifacts() { + rm -f /logs/fixes.log +} + main \ No newline at end of file diff --git a/ga/latest/kernel/helpers/build/populate_scc.sh b/ga/latest/kernel/helpers/build/populate_scc.sh index ac2b762e..8892f08e 100755 --- a/ga/latest/kernel/helpers/build/populate_scc.sh +++ b/ga/latest/kernel/helpers/build/populate_scc.sh @@ -1,5 +1,5 @@ #!/bin/bash -# (C) Copyright IBM Corporation 2020, 2025. +# (C) Copyright IBM Corporation 2020, 2026. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -. /opt/ibm/helpers/build/internal/logger.sh +. /opt/ibm/helpers/build/internal/utils.sh set -Eeox pipefail From 19cb4fc9d4805458824a938231f46f94c57c6a80 Mon Sep 17 00:00:00 2001 From: Kirby Chin <37311900+kabicin@users.noreply.github.com> Date: Tue, 6 Jan 2026 15:18:20 -0500 Subject: [PATCH 2/2] Update install message --- ga/latest/kernel/helpers/build/features.sh | 2 +- ga/latest/kernel/helpers/build/internal/utils.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ga/latest/kernel/helpers/build/features.sh b/ga/latest/kernel/helpers/build/features.sh index efbcf0a2..aee161be 100755 --- a/ga/latest/kernel/helpers/build/features.sh +++ b/ga/latest/kernel/helpers/build/features.sh @@ -48,4 +48,4 @@ find /opt/ibm/wlp/lib /opt/ibm/wlp/bin ! -perm -g=rw -print0 | xargs -0 -r chmod # Note: This step should only be done ONCE needed features are enabled and installed. installFixes -echo "features.sh script has been run" > /logs/features.log +echo "features.sh script has been run successfully" > /logs/features.log diff --git a/ga/latest/kernel/helpers/build/internal/utils.sh b/ga/latest/kernel/helpers/build/internal/utils.sh index e36c9fd8..ea2a1b5f 100755 --- a/ga/latest/kernel/helpers/build/internal/utils.sh +++ b/ga/latest/kernel/helpers/build/internal/utils.sh @@ -32,7 +32,7 @@ function showLogs() { function installFixes() { if [ ! -f "/logs/fixes.log" ] && ls "/opt/$WLP_TYPE/fixes"/*.jar 1> /dev/null 2>&1; then find /opt/$WLP_TYPE/fixes -type f -name "*.jar" -print0 | sort -z | xargs -0 -n 1 -r -I {} java -jar {} --installLocation $WLP_INSTALL_DIR - echo "installFixes has been run" > /logs/fixes.log + echo "installFixes has been run successfully" > /logs/fixes.log fi }