Skip to content

Commit 5d5f4f3

Browse files
committed
Update 22.0.0.8
1 parent bf20717 commit 5d5f4f3

File tree

12 files changed

+502
-92
lines changed

12 files changed

+502
-92
lines changed

ga/22.0.0.12/kernel/helpers/build/configuration_snippets/sessioncache-features.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
<featureManager>
33
<feature>sessionCache-1.0</feature>
44
</featureManager>
5-
</server>
5+
</server>
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/bin/bash
2+
3+
# If the Liberty server name is not defaultServer and defaultServer still exists migrate the contents
4+
if [ "$SERVER_NAME" != "defaultServer" ] && [ -d "/opt/ibm/wlp/usr/servers/defaultServer" ]; then
5+
# Create new Liberty server
6+
/opt/ibm/wlp/bin/server create >/tmp/serverOutput
7+
rc=$?
8+
if [ $rc -ne 0 ]; then
9+
cat /tmp/serverOutput
10+
rm /tmp/serverOutput
11+
exit $rc
12+
fi
13+
rm /tmp/serverOutput
14+
15+
# Verify server creation
16+
if [ ! -d "/opt/ibm/wlp/usr/servers/$SERVER_NAME" ]; then
17+
echo "The server name contains a character that is not valid."
18+
exit 1
19+
fi
20+
chmod -R g+w /opt/ibm/wlp/usr/servers/$SERVER_NAME
21+
22+
# Delete old symlinks
23+
rm /opt/ibm/links/output
24+
rm /opt/ibm/links/config
25+
26+
# Add new output folder symlink and resolve group write permissions
27+
mkdir -p $WLP_OUTPUT_DIR/$SERVER_NAME
28+
ln -s $WLP_OUTPUT_DIR/$SERVER_NAME /opt/ibm/links/output
29+
chmod g+w $WLP_OUTPUT_DIR/$SERVER_NAME
30+
mkdir -p $WLP_OUTPUT_DIR/$SERVER_NAME/resources
31+
mkdir -p $WLP_OUTPUT_DIR/$SERVER_NAME/workarea
32+
mkdir -p $WLP_OUTPUT_DIR/$SERVER_NAME/logs
33+
chmod -R g+w $WLP_OUTPUT_DIR/$SERVER_NAME/workarea
34+
chmod -R g+w,o-rwx $WLP_OUTPUT_DIR/$SERVER_NAME/resources
35+
chmod -R g+w,o-rwx $WLP_OUTPUT_DIR/$SERVER_NAME/logs
36+
37+
# Hand over the SCC
38+
if [ "$OPENJ9_SCC" = "true" ] && [ -d "/opt/ibm/wlp/output/defaultServer/.classCache" ]; then
39+
mv /opt/ibm/wlp/output/defaultServer/.classCache $WLP_OUTPUT_DIR/$SERVER_NAME/
40+
fi
41+
rm -rf /opt/ibm/wlp/output/defaultServer
42+
43+
# Add new server symlink and populate folder
44+
mv /opt/ibm/wlp/usr/servers/defaultServer/* /opt/ibm/wlp/usr/servers/$SERVER_NAME/
45+
ln -s /opt/ibm/wlp/usr/servers/$SERVER_NAME /opt/ibm/links/config
46+
mkdir -p /config/configDropins/defaults
47+
mkdir -p /config/configDropins/overrides
48+
chmod -R g+w /config
49+
50+
rm -rf /opt/ibm/wlp/usr/servers/defaultServer
51+
fi
52+
53+
echo "configure-liberty.sh script has been run" > /opt/ibm/wlp/configure-liberty.log
54+
exit 0

ga/22.0.0.12/kernel/helpers/runtime/docker-server.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ function importKeyCert() {
8484
fi
8585
}
8686

87+
# Resolve liberty server symlinks and creation for server name changes
88+
/opt/ibm/helpers/runtime/configure-liberty.sh
89+
if [ $? -ne 0 ]; then
90+
exit
91+
fi
92+
8793
case "${LICENSE,,}" in
8894
"accept" ) # Suppress license message in logs
8995
grep -s -F "com.ibm.ws.logging.hideMessage" /config/bootstrap.properties \
@@ -140,6 +146,8 @@ if [[ -n "$INFINISPAN_SERVICE_NAME" ]]; then
140146
echo "INFINISPAN_PASS: ${INFINISPAN_PASS}"
141147
fi
142148

149+
# Remove generated metadata
150+
rm /opt/ibm/wlp/configure-liberty.log
143151

144152
# Pass on to the real server run
145153
exec "$@"
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
#!/bin/bash
2+
# (C) Copyright IBM Corporation 2022.
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.
15+
16+
# Determine if featureUtility ran in an earlier build step
17+
if [ -f "/opt/ibm/wlp/configure-liberty.log" ]; then
18+
FEATURES_INSTALLED=true
19+
else
20+
FEATURES_INSTALLED=false
21+
>&2 echo "WARNING: This is not an optimal build configuration. Although features in server.xml will continue to be installed correctly, the 'RUN features.sh' command should be added to the Dockerfile prior to configure.sh. See https://github.com/WASdev/ci.docker#building-an-application-image for a sample application image template."
22+
fi
23+
24+
if [ "$VERBOSE" != "true" ]; then
25+
exec &>/dev/null
26+
fi
27+
28+
set -Eeox pipefail
29+
30+
function main() {
31+
if [ "$FEATURES_INSTALLED" == "false" ]; then
32+
# Resolve liberty server symlinks and creation for server name changes
33+
/opt/ibm/helpers/runtime/configure-liberty.sh
34+
if [ $? -ne 0 ]; then
35+
exit
36+
fi
37+
fi
38+
39+
##Define variables for XML snippets source and target paths
40+
WLP_INSTALL_DIR=/opt/ibm/wlp
41+
SHARED_CONFIG_DIR=${WLP_INSTALL_DIR}/usr/shared/config
42+
SHARED_RESOURCE_DIR=${WLP_INSTALL_DIR}/usr/shared/resources
43+
44+
SNIPPETS_SOURCE=/opt/ibm/helpers/build/configuration_snippets
45+
SNIPPETS_TARGET=/config/configDropins/overrides
46+
SNIPPETS_TARGET_DEFAULTS=/config/configDropins/defaults
47+
mkdir -p ${SNIPPETS_TARGET}
48+
mkdir -p ${SNIPPETS_TARGET_DEFAULTS}
49+
50+
#Check for each Liberty value-add functionality
51+
52+
# Infinispan Session Caching
53+
if [[ -n "$INFINISPAN_SERVICE_NAME" ]]; then
54+
cp ${SNIPPETS_SOURCE}/infinispan-client-sessioncache.xml ${SNIPPETS_TARGET}/infinispan-client-sessioncache.xml
55+
chmod g+rw $SNIPPETS_TARGET/infinispan-client-sessioncache.xml
56+
fi
57+
58+
# Hazelcast Session Caching
59+
if [ "${HZ_SESSION_CACHE}" == "client" ] || [ "${HZ_SESSION_CACHE}" == "embedded" ]; then
60+
cp ${SNIPPETS_SOURCE}/hazelcast-sessioncache.xml ${SNIPPETS_TARGET}/hazelcast-sessioncache.xml
61+
mkdir -p ${SHARED_CONFIG_DIR}/hazelcast
62+
cp ${SNIPPETS_SOURCE}/hazelcast-${HZ_SESSION_CACHE}.xml ${SHARED_CONFIG_DIR}/hazelcast/hazelcast.xml
63+
fi
64+
65+
# Key Store
66+
keystorePath="$SNIPPETS_TARGET_DEFAULTS/keystore.xml"
67+
if [ "$SSL" != "false" ] && [ "$TLS" != "false" ]
68+
then
69+
if [ ! -e $keystorePath ]
70+
then
71+
# Generate the keystore.xml
72+
export KEYSTOREPWD=$(openssl rand -base64 32)
73+
sed "s|REPLACE|$KEYSTOREPWD|g" $SNIPPETS_SOURCE/keystore.xml > $SNIPPETS_TARGET_DEFAULTS/keystore.xml
74+
chmod g+w $SNIPPETS_TARGET_DEFAULTS/keystore.xml
75+
fi
76+
fi
77+
78+
# SSO
79+
if [[ -n "$SEC_SSO_PROVIDERS" ]]; then
80+
parseProviders $SEC_SSO_PROVIDERS
81+
fi
82+
83+
if [ "$SKIP_FEATURE_INSTALL" != "true" ]; then
84+
# Install needed features
85+
if [ "$FEATURE_REPO_URL" ]; then
86+
curl -k --fail $FEATURE_REPO_URL > /tmp/repo.zip
87+
installUtility install --acceptLicense defaultServer --from=/tmp/repo.zip || rc=$?; if [ $rc -ne 22 ]; then exit $rc; fi
88+
rm -rf /tmp/repo.zip
89+
# Otherwise, if features.sh did not run, install server features.
90+
elif [ "$FEATURES_INSTALLED" == "false" ]; then
91+
featureUtility installServerFeatures --acceptLicense defaultServer --noCache
92+
find /opt/ibm/wlp/lib /opt/ibm/wlp/bin ! -perm -g=rw -print0 | xargs -0 -r chmod g+rw
93+
fi
94+
fi
95+
96+
# Apply interim fixes found in /opt/ibm/fixes
97+
# Fixes recommended by IBM, such as to resolve security vulnerabilities, are also included in /opt/ibm/fixes
98+
# Note: This step should be done once needed features are enabled and installed using installUtility.
99+
100+
# Do not create a SCC
101+
if [ -n "${IBM_JAVA_OPTIONS}" ]; then
102+
IBM_JAVA_OPTIONS="${IBM_JAVA_OPTIONS} -Xshareclasses:none"
103+
fi
104+
105+
if [ -n "${OPENJ9_JAVA_OPTIONS}" ]; then
106+
OPENJ9_JAVA_OPTIONS="${OPENJ9_JAVA_OPTIONS} -Xshareclasses:none"
107+
fi
108+
109+
find /opt/ibm/fixes -type f -name "*.jar" -print0 | sort -z | xargs -0 -n 1 -r -I {} java -jar {} --installLocation $WLP_INSTALL_DIR
110+
#Make sure that group write permissions are set correctly after installing new features
111+
find /opt/ibm/wlp ! -perm -g=rw -print0 | xargs -r -0 chmod g+rw
112+
113+
# Create a new SCC layer
114+
if [ "$OPENJ9_SCC" == "true" ]
115+
then
116+
populate_scc.sh -i 1
117+
fi
118+
}
119+
120+
## parse provider list to generate files into configDropins
121+
function parseProviders() {
122+
while [ $# -gt 0 ]; do
123+
case "$1" in
124+
oidc:*)
125+
parseCommaList oidc "${1#*:}"
126+
;;
127+
oauth2:*)
128+
parseCommaList oauth2 "${1#*:}"
129+
;;
130+
*)
131+
if [[ $(ls $SNIPPETS_SOURCE | grep "$1") ]]; then
132+
cp $SNIPPETS_SOURCE/sso-${1}.xml $SNIPPETS_TARGET_DEFAULTS
133+
fi
134+
;;
135+
esac
136+
shift
137+
done
138+
}
139+
140+
## process the comma delimitted oauth2/oidc source lists
141+
function parseCommaList() {
142+
local type="$1"
143+
local list=$(echo "$2" | tr , " ")
144+
145+
for current in ${list}; do
146+
if [[ "${type}" = "oidc" ]]; then
147+
# replace oidc identifiers with custom name
148+
sed -e 's/=\"oidc/=\"'${current}'/g' -e 's/_OIDC_/_'${current^^}'_/g' $SNIPPETS_SOURCE/sso-oidc.xml > $SNIPPETS_TARGET_DEFAULTS/sso-${current}.xml
149+
else
150+
# replace oauth2 identifiers with custom name
151+
sed -e 's/=\"oauth2/=\"'${current}'/g' -e 's/_OAUTH2_/_'${current^^}'_/g' $SNIPPETS_SOURCE/sso-oauth2.xml > $SNIPPETS_TARGET_DEFAULTS/sso-${current}.xml
152+
fi
153+
done
154+
}
155+
156+
main "$@"
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/bin/bash
2+
# (C) Copyright IBM Corporation 2022.
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.
15+
if [ "$VERBOSE" != "true" ]; then
16+
exec &>/dev/null
17+
fi
18+
19+
set -Eeox pipefail
20+
21+
# Resolve liberty server symlinks and creation for server name changes
22+
/opt/ibm/helpers/runtime/configure-liberty.sh
23+
if [ $? -ne 0 ]; then
24+
exit
25+
fi
26+
27+
##Define variables for XML snippets source and target paths
28+
SNIPPETS_SOURCE=/opt/ibm/helpers/build/configuration_snippets
29+
SNIPPETS_TARGET=/config/configDropins/overrides
30+
SNIPPETS_TARGET_DEFAULTS=/config/configDropins/defaults
31+
mkdir -p ${SNIPPETS_TARGET}
32+
mkdir -p ${SNIPPETS_TARGET_DEFAULTS}
33+
34+
# Session Caching
35+
if [ -n "$INFINISPAN_SERVICE_NAME" ] || [ "${HZ_SESSION_CACHE}" == "client" ] || [ "${HZ_SESSION_CACHE}" == "embedded" ]; then
36+
cp ${SNIPPETS_SOURCE}/sessioncache-features.xml ${SNIPPETS_TARGET}/sessioncache-features.xml
37+
chmod g+rw $SNIPPETS_TARGET/sessioncache-features.xml
38+
fi
39+
40+
# SSO
41+
if [[ -n "$SEC_SSO_PROVIDERS" ]]; then
42+
cp $SNIPPETS_SOURCE/sso-features.xml $SNIPPETS_TARGET_DEFAULTS
43+
fi
44+
45+
# Key Store
46+
if [ "$SSL" == "true" ] || [ "$TLS" == "true" ]; then
47+
cp $SNIPPETS_SOURCE/tls.xml $SNIPPETS_TARGET/tls.xml
48+
fi
49+
50+
# Install necessary features using featureUtility
51+
featureUtility installServerFeatures --acceptLicense defaultServer --noCache
52+
find /opt/ibm/wlp/lib /opt/ibm/wlp/bin ! -perm -g=rw -print0 | xargs -0 -r chmod g+rw

ga/23.0.0.5/kernel/Dockerfile.ubi.ibmjava8

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ ARG EN_SHA=16669604ed86a6ad4bd60b99ca85fad2a819ae3ff3e68d5585a64f3d51504ee3
2020
ARG NON_IBM_SHA=89faf793b9e068a80bda72d6c1cbf9b4e1362c699525710ae3247a6c135a0b11
2121
ARG NOTICES_SHA=f02cefd8eb429cd471b9f494c2ac7f3df10ef042f1b7e8271895afd2a46ae997
2222

23+
ENV SERVER_NAME=defaultServer
24+
2325
LABEL org.opencontainers.image.authors="Leo Christy Jesuraj, Arthur De Magalhaes, Chris Potter" \
2426
org.opencontainers.image.vendor="IBM" \
2527
org.opencontainers.image.url="http://wasdev.net" \
@@ -83,32 +85,50 @@ RUN mkdir /logs \
8385
&& mkdir /etc/wlp \
8486
&& mkdir -p /opt/ibm/wlp/usr/shared/resources/lib.index.cache \
8587
&& mkdir -p /home/default \
86-
&& mkdir /output \
87-
&& chmod -t /output \
88-
&& rm -rf /output \
89-
&& ln -s $WLP_OUTPUT_DIR/defaultServer /output \
90-
&& ln -s /opt/ibm/wlp/usr/servers/defaultServer /config \
9188
&& ln -s /opt/ibm /liberty \
9289
&& ln -s /opt/ibm/fixes /fixes \
9390
&& ln -s /opt/ibm/wlp/usr/shared/resources/lib.index.cache /lib.index.cache \
94-
&& mkdir -p /config/configDropins/defaults \
95-
&& mkdir -p /config/configDropins/overrides \
96-
&& chown -R 1001:0 /config \
97-
&& chmod -R g+rw /config \
9891
&& chown -R 1001:0 /opt/ibm/helpers \
9992
&& chmod -R g+rwx /opt/ibm/helpers \
10093
&& chown -R 1001:0 /opt/ibm/fixes \
10194
&& chmod -R g+rwx /opt/ibm/fixes \
10295
&& chown -R 1001:0 /opt/ibm/wlp/usr \
10396
&& chmod -R g+rw /opt/ibm/wlp/usr \
104-
&& chown -R 1001:0 /opt/ibm/wlp/output \
105-
&& chmod -R g+rw /opt/ibm/wlp/output \
10697
&& chown -R 1001:0 /logs \
10798
&& chmod -R g+rw /logs \
10899
&& chown -R 1001:0 /etc/wlp \
109100
&& chmod -R g+rw /etc/wlp \
110101
&& chown -R 1001:0 /home/default \
111-
&& chmod -R g+rw /home/default
102+
&& chmod -R g+rw /home/default \
103+
&& mkdir -p /opt/ibm/links \
104+
&& chown -R 1001:0 /opt/ibm/links \
105+
&& chmod -R g+rw /opt/ibm/links
106+
107+
# Create second-level symlinks as non-root user
108+
USER 1001
109+
110+
RUN mkdir -p $WLP_OUTPUT_DIR/defaultServer \
111+
&& ln -s $WLP_OUTPUT_DIR/defaultServer /opt/ibm/links/output \
112+
&& ln -s /opt/ibm/wlp/usr/servers/defaultServer /opt/ibm/links/config \
113+
&& mkdir -p /opt/ibm/links/config/configDropins/defaults \
114+
&& mkdir -p /opt/ibm/links/config/configDropins/overrides
115+
116+
# Create first-level symlinks as root user
117+
USER 0
118+
119+
RUN mkdir /output \
120+
&& chmod -t /output \
121+
&& rm -rf /output \
122+
&& ln -s /opt/ibm/links/output /output \
123+
&& ln -s /opt/ibm/links/config /config \
124+
&& chown -R 1001:0 /opt/ibm/links/output \
125+
&& chmod -R g+rw /opt/ibm/links/output \
126+
&& chown -R 1001:0 /opt/ibm/links/config \
127+
&& chmod -R g+rw /opt/ibm/links/config \
128+
&& chown -R 1001:0 /config \
129+
&& chmod -R g+rw /config \
130+
&& chown -R 1001:0 /output \
131+
&& chmod -R g+rw /output
112132

113133
# Create a new SCC layer
114134
RUN if [ "$OPENJ9_SCC" = "true" ]; then populate_scc.sh; fi \
@@ -125,4 +145,4 @@ USER 1001
125145
EXPOSE 9080 9443
126146

127147
ENTRYPOINT ["/opt/ibm/helpers/runtime/docker-server.sh"]
128-
CMD ["/opt/ibm/wlp/bin/server", "run", "defaultServer"]
148+
CMD ["/opt/ibm/wlp/bin/server", "run"]

0 commit comments

Comments
 (0)