Skip to content

Commit 939cea5

Browse files
committed
Install ifixes in features.sh
1 parent 81b52e4 commit 939cea5

File tree

7 files changed

+50
-18
lines changed

7 files changed

+50
-18
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,16 @@ COPY --chown=1001:0 server.xml /config/
4040
# A sample is in the 'Getting Required Features' section below
4141
COPY --chown=1001:0 featureUtility.properties /opt/ibm/wlp/etc/
4242

43-
# This script will add the requested XML snippets to enable Liberty features and grow the image to be fit-for-purpose using featureUtility.
44-
RUN features.sh
45-
4643
# Add interim fixes (optional)
4744
COPY --chown=1001:0 interim-fixes /opt/ibm/fixes/
4845

46+
# 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.
47+
RUN features.sh
48+
4949
# Add application
5050
COPY --chown=1001:0 Sample1.war /config/dropins/
5151

52-
# This script will add the requested server configurations, apply any interim fixes and populate caches to optimize runtime
52+
# This script will add the requested server configurations and populate caches to optimize runtime
5353
RUN configure.sh
5454
```
5555

ga/latest/kernel/helpers/build/configure.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# (C) Copyright IBM Corporation 2020, 2025.
2+
# (C) Copyright IBM Corporation 2020, 2026.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@ else
2020
FEATURES_INSTALLED=false
2121
fi
2222

23-
. /opt/ibm/helpers/build/internal/logger.sh
23+
. /opt/ibm/helpers/build/internal/utils.sh
2424

2525
set -Eeo pipefail
2626

@@ -150,10 +150,6 @@ function main() {
150150
fi
151151
fi
152152

153-
# Apply interim fixes found in /opt/ibm/fixes
154-
# Fixes recommended by IBM, such as to resolve security vulnerabilities, are also included in /opt/ibm/fixes
155-
# Note: This step should be done once needed features are enabled and installed using installUtility.
156-
157153
# Do not create a SCC
158154
if [ -n "${IBM_JAVA_OPTIONS}" ]; then
159155
IBM_JAVA_OPTIONS="${IBM_JAVA_OPTIONS} -Xshareclasses:none"
@@ -163,7 +159,10 @@ function main() {
163159
OPENJ9_JAVA_OPTIONS="${OPENJ9_JAVA_OPTIONS} -Xshareclasses:none"
164160
fi
165161

166-
find /opt/ibm/fixes -type f -name "*.jar" -print0 | sort -z | xargs -0 -n 1 -r -I {} java -jar {} --installLocation $WLP_INSTALL_DIR
162+
# Apply interim fixes found in /opt/ibm/fixes
163+
# Fixes recommended by IBM, such as to resolve security vulnerabilities, are also included in /opt/ibm/fixes
164+
# Note: This step should only be done ONCE needed features are enabled and installed.
165+
installFixes
167166
#Make sure that group write permissions are set correctly after installing new features
168167
find /opt/ibm/wlp ! -perm -g=rw -print0 | xargs -r -0 chmod g+rw
169168

@@ -193,6 +192,8 @@ function main() {
193192
fi
194193
eval $cmd
195194
fi
195+
196+
removeBuildArtifacts
196197
}
197198

198199
## parse provider list to generate files into configDropins

ga/latest/kernel/helpers/build/features.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# (C) Copyright IBM Corporation 2023, 2025.
2+
# (C) Copyright IBM Corporation 2023, 2026.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -12,7 +12,7 @@
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15-
. /opt/ibm/helpers/build/internal/logger.sh
15+
. /opt/ibm/helpers/build/internal/utils.sh
1616

1717
set -Eeo pipefail
1818

@@ -43,4 +43,9 @@ fi
4343
featureUtility installServerFeatures --acceptLicense defaultServer --noCache
4444
find /opt/ibm/wlp/lib /opt/ibm/wlp/bin ! -perm -g=rw -print0 | xargs -0 -r chmod g+rw
4545

46+
# Apply interim fixes found in /opt/ibm/fixes
47+
# Fixes recommended by IBM, such as to resolve security vulnerabilities, are also included in /opt/ibm/fixes
48+
# Note: This step should only be done ONCE needed features are enabled and installed.
49+
installFixes
50+
4651
echo "features.sh script has been run" > /logs/features.log

ga/latest/kernel/helpers/build/infinispan-client-setup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# (C) Copyright IBM Corporation 2020, 2025.
2+
# (C) Copyright IBM Corporation 2020, 2026.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -12,7 +12,7 @@
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15-
. /opt/ibm/helpers/build/internal/logger.sh
15+
. /opt/ibm/helpers/build/internal/utils.sh
1616

1717
set -Eeo pipefail
1818

ga/latest/kernel/helpers/build/internal/features-installed.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
11
#!/bin/bash
2+
# (C) Copyright IBM Corporation 2025, 2026.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
215

316
if [ -f "/logs/features.log" ]; then
417
rm /logs/features.log

ga/latest/kernel/helpers/build/internal/logger.sh renamed to ga/latest/kernel/helpers/build/internal/utils.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# (C) Copyright IBM Corporation 2025.
2+
# (C) Copyright IBM Corporation 2025, 2026.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -14,6 +14,8 @@
1414
# limitations under the License.
1515

1616
function main() {
17+
WLP_TYPE=ibm
18+
WLP_INSTALL_DIR=/opt/$WLP_TYPE/wlp
1719
if [ "$VERBOSE" != "true" ]; then
1820
exec >/dev/null
1921
else
@@ -29,4 +31,15 @@ function showLogs() {
2931
exec 1>&3 3>&- 2>&4 4>&-
3032
}
3133

34+
function installFixes() {
35+
if [ ! -f "/logs/fixes.log" ] && ls "/opt/$WLP_TYPE/fixes"/*.jar 1> /dev/null 2>&1; then
36+
find /opt/$WLP_TYPE/fixes -type f -name "*.jar" -print0 | sort -z | xargs -0 -n 1 -r -I {} java -jar {} --installLocation $WLP_INSTALL_DIR
37+
echo "installFixes has been run" > /logs/fixes.log
38+
fi
39+
}
40+
41+
function removeBuildArtifacts() {
42+
rm -f /logs/fixes.log
43+
}
44+
3245
main

ga/latest/kernel/helpers/build/populate_scc.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# (C) Copyright IBM Corporation 2020, 2025.
2+
# (C) Copyright IBM Corporation 2020, 2026.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -12,7 +12,7 @@
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15-
. /opt/ibm/helpers/build/internal/logger.sh
15+
. /opt/ibm/helpers/build/internal/utils.sh
1616

1717
set -Eeo pipefail
1818

0 commit comments

Comments
 (0)