Skip to content

Commit 799950b

Browse files
committed
Add symlink for serviceability
1 parent a0bff75 commit 799950b

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

releases/latest/kernel-slim/Dockerfile.ubi.openjdk8

+9-6
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,18 @@ RUN mkdir -p /opt/ol/wlp/usr/shared/resources/lib.index.cache \
132132
&& echo "<server description=\"Default Server\"><httpEndpoint id=\"defaultHttpEndpoint\" host=\"*\" /></server>" > /config/configDropins/defaults/open-default-port.xml \
133133
&& mkdir -p /opt/ol/links \
134134
&& chown -R 1001:0 /opt/ol/links \
135-
&& chmod -R g+rw /opt/ol/links
135+
&& chmod -R g+rw /opt/ol/links \
136+
&& mkdir -p /opt/ol/logs \
137+
&& chown -R 1001:0 /opt/ol/logs \
138+
&& chmod -R g+rw /opt/ol/logs \
139+
&& mkdir -p /serviceability \
140+
&& chown -R 1001:0 /serviceability \
141+
&& chmod -R g+rw /serviceability
136142

137143
USER 1001
138-
RUN mkdir -p /serviceability/logs \
139-
&& ln -s /serviceability/logs /opt/ol/links/logs
144+
RUN ln -s /opt/ol/logs /opt/ol/links/logs
140145
USER root
141-
RUN ln -s /logs /opt/ol/links/logs \
142-
&& chown -R 1001:0 /logs \
143-
&& chmod -R g+rw /logs
146+
RUN ln -s /opt/ol/links/logs /logs
144147

145148
# Create a new SCC layer
146149
RUN if [ "$OPENJ9_SCC" = "true" ]; then populate_scc.sh; fi \

releases/latest/kernel-slim/helpers/runtime/docker-server.sh

+6
Original file line numberDiff line numberDiff line change
@@ -141,5 +141,11 @@ elif [[ ! -z "$WLP_CHECKPOINT" ]]; then
141141
checkpoint.sh "$TMP_CHECKPOINT"
142142
else
143143
# The default is to just exec the supplied CMD
144+
if [[ ! -z "$SERVICEABILITY_NAMESPACE" ]] && [[ ! -z $SERVICEABILITY_NAME ]]; then
145+
SERVICEABILITY_FOLDER="/serviceability/$SERVICEABILITY_NAMESPACE/$SERVICEABILITY_NAME"
146+
mkdir -p $SERVICEABILITY_FOLDER
147+
rm -f /opt/ol/links/logs
148+
ln -s $SERVICEABILITY_FOLDER /opt/ol/links/logs
149+
fi
144150
exec "$@"
145151
fi

0 commit comments

Comments
 (0)