Skip to content

Commit 4de1930

Browse files
committed
Update kernel Dockerfiles for serviceability
1 parent 31c7daa commit 4de1930

9 files changed

+134
-40
lines changed

ga/latest/kernel/Dockerfile.ubi.ibmjava8

+16-5
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,7 @@ COPY helpers/ /opt/ibm/helpers/
131131
COPY fixes/ /opt/ibm/fixes/
132132

133133
# Create symlinks && set permissions for non-root user
134-
RUN mkdir /logs \
135-
&& mkdir /etc/wlp \
134+
RUN mkdir /etc/wlp \
136135
&& mkdir -p /opt/ibm/wlp/usr/shared/resources/lib.index.cache \
137136
&& mkdir -p /home/default \
138137
&& mkdir /output \
@@ -155,12 +154,24 @@ RUN mkdir /logs \
155154
&& chmod -R g+rw /opt/ibm/wlp/usr \
156155
&& chown -R 1001:0 /opt/ibm/wlp/output \
157156
&& chmod -R g+rw /opt/ibm/wlp/output \
158-
&& chown -R 1001:0 /logs \
159-
&& chmod -R g+rw /logs \
160157
&& chown -R 1001:0 /etc/wlp \
161158
&& chmod -R g+rw /etc/wlp \
162159
&& chown -R 1001:0 /home/default \
163-
&& chmod -R g+rw /home/default
160+
&& chmod -R g+rw /home/default \
161+
&& mkdir -p /opt/ibm/links \
162+
&& chown -R 1001:0 /opt/ibm/links \
163+
&& chmod -R g+rw /opt/ibm/links \
164+
&& mkdir -p /opt/ibm/logs \
165+
&& chown -R 1001:0 /opt/ibm/logs \
166+
&& chmod -R g+rw /opt/ibm/logs \
167+
&& mkdir -p /serviceability \
168+
&& chown -R 1001:0 /serviceability \
169+
&& chmod -R g+rw /serviceability
170+
171+
USER 1001
172+
RUN ln -s /opt/ibm/logs /opt/ibm/links/logs
173+
USER root
174+
RUN ln -s /opt/ibm/links/logs /logs
164175

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

ga/latest/kernel/Dockerfile.ubi.openjdk11

+16-5
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,7 @@ COPY helpers/ /opt/ibm/helpers/
132132
COPY fixes/ /opt/ibm/fixes/
133133

134134
# Create symlinks && set permissions for non-root user
135-
RUN mkdir /logs \
136-
&& mkdir /etc/wlp \
135+
RUN mkdir /etc/wlp \
137136
&& mkdir -p /opt/ibm/wlp/usr/shared/resources/lib.index.cache \
138137
&& mkdir -p /home/default \
139138
&& mkdir /output \
@@ -156,13 +155,25 @@ RUN mkdir /logs \
156155
&& chmod -R g+rw /opt/ibm/wlp/usr \
157156
&& chown -R 1001:0 /opt/ibm/wlp/output \
158157
&& chmod -R g+rw /opt/ibm/wlp/output \
159-
&& chown -R 1001:0 /logs \
160-
&& chmod -R g+rw /logs \
161158
&& chown -R 1001:0 /etc/wlp \
162159
&& chmod -R g+rw /etc/wlp \
163160
&& if [ -e /etc/instanton.ld.so.cache ]; then chmod g+w /etc/ld.so.cache; fi \
164161
&& chown -R 1001:0 /home/default \
165-
&& chmod -R g+rw /home/default
162+
&& chmod -R g+rw /home/default \
163+
&& mkdir -p /opt/ibm/links \
164+
&& chown -R 1001:0 /opt/ibm/links \
165+
&& chmod -R g+rw /opt/ibm/links \
166+
&& mkdir -p /opt/ibm/logs \
167+
&& chown -R 1001:0 /opt/ibm/logs \
168+
&& chmod -R g+rw /opt/ibm/logs \
169+
&& mkdir -p /serviceability \
170+
&& chown -R 1001:0 /serviceability \
171+
&& chmod -R g+rw /serviceability
172+
173+
USER 1001
174+
RUN ln -s /opt/ibm/logs /opt/ibm/links/logs
175+
USER root
176+
RUN ln -s /opt/ibm/links/logs /logs
166177

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

ga/latest/kernel/Dockerfile.ubi.openjdk17

+16-5
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,7 @@ COPY helpers/ /opt/ibm/helpers/
131131
COPY fixes/ /opt/ibm/fixes/
132132

133133
# Create symlinks && set permissions for non-root user
134-
RUN mkdir /logs \
135-
&& mkdir /etc/wlp \
134+
RUN mkdir /etc/wlp \
136135
&& mkdir -p /opt/ibm/wlp/usr/shared/resources/lib.index.cache \
137136
&& mkdir -p /home/default \
138137
&& mkdir /output \
@@ -155,13 +154,25 @@ RUN mkdir /logs \
155154
&& chmod -R g+rw /opt/ibm/wlp/usr \
156155
&& chown -R 1001:0 /opt/ibm/wlp/output \
157156
&& chmod -R g+rw /opt/ibm/wlp/output \
158-
&& chown -R 1001:0 /logs \
159-
&& chmod -R g+rw /logs \
160157
&& chown -R 1001:0 /etc/wlp \
161158
&& chmod -R g+rw /etc/wlp \
162159
&& if [ -e /etc/instanton.ld.so.cache ]; then chmod g+w /etc/ld.so.cache; fi \
163160
&& chown -R 1001:0 /home/default \
164-
&& chmod -R g+rw /home/default
161+
&& chmod -R g+rw /home/default \
162+
&& mkdir -p /opt/ibm/links \
163+
&& chown -R 1001:0 /opt/ibm/links \
164+
&& chmod -R g+rw /opt/ibm/links \
165+
&& mkdir -p /opt/ibm/logs \
166+
&& chown -R 1001:0 /opt/ibm/logs \
167+
&& chmod -R g+rw /opt/ibm/logs \
168+
&& mkdir -p /serviceability \
169+
&& chown -R 1001:0 /serviceability \
170+
&& chmod -R g+rw /serviceability
171+
172+
USER 1001
173+
RUN ln -s /opt/ibm/logs /opt/ibm/links/logs
174+
USER root
175+
RUN ln -s /opt/ibm/links/logs /logs
165176

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

ga/latest/kernel/Dockerfile.ubi.openjdk21

+16-5
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,7 @@ COPY helpers/ /opt/ibm/helpers/
131131
COPY fixes/ /opt/ibm/fixes/
132132

133133
# Create symlinks && set permissions for non-root user
134-
RUN mkdir /logs \
135-
&& mkdir /etc/wlp \
134+
RUN mkdir /etc/wlp \
136135
&& mkdir -p /opt/ibm/wlp/usr/shared/resources/lib.index.cache \
137136
&& mkdir -p /home/default \
138137
&& mkdir /output \
@@ -155,13 +154,25 @@ RUN mkdir /logs \
155154
&& chmod -R g+rw /opt/ibm/wlp/usr \
156155
&& chown -R 1001:0 /opt/ibm/wlp/output \
157156
&& chmod -R g+rw /opt/ibm/wlp/output \
158-
&& chown -R 1001:0 /logs \
159-
&& chmod -R g+rw /logs \
160157
&& chown -R 1001:0 /etc/wlp \
161158
&& chmod -R g+rw /etc/wlp \
162159
&& if [ -e /etc/instanton.ld.so.cache ]; then chmod g+w /etc/ld.so.cache; fi \
163160
&& chown -R 1001:0 /home/default \
164-
&& chmod -R g+rw /home/default
161+
&& chmod -R g+rw /home/default \
162+
&& mkdir -p /opt/ibm/links \
163+
&& chown -R 1001:0 /opt/ibm/links \
164+
&& chmod -R g+rw /opt/ibm/links \
165+
&& mkdir -p /opt/ibm/logs \
166+
&& chown -R 1001:0 /opt/ibm/logs \
167+
&& chmod -R g+rw /opt/ibm/logs \
168+
&& mkdir -p /serviceability \
169+
&& chown -R 1001:0 /serviceability \
170+
&& chmod -R g+rw /serviceability
171+
172+
USER 1001
173+
RUN ln -s /opt/ibm/logs /opt/ibm/links/logs
174+
USER root
175+
RUN ln -s /opt/ibm/links/logs /logs
165176

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

ga/latest/kernel/Dockerfile.ubi.openjdk8

+16-5
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,7 @@ COPY helpers/ /opt/ibm/helpers/
131131
COPY fixes/ /opt/ibm/fixes/
132132

133133
# Create symlinks && set permissions for non-root user
134-
RUN mkdir /logs \
135-
&& mkdir /etc/wlp \
134+
RUN mkdir /etc/wlp \
136135
&& mkdir -p /opt/ibm/wlp/usr/shared/resources/lib.index.cache \
137136
&& mkdir -p /home/default \
138137
&& mkdir /output \
@@ -155,13 +154,25 @@ RUN mkdir /logs \
155154
&& chmod -R g+rw /opt/ibm/wlp/usr \
156155
&& chown -R 1001:0 /opt/ibm/wlp/output \
157156
&& chmod -R g+rw /opt/ibm/wlp/output \
158-
&& chown -R 1001:0 /logs \
159-
&& chmod -R g+rw /logs \
160157
&& chown -R 1001:0 /etc/wlp \
161158
&& chmod -R g+rw /etc/wlp \
162159
&& if [ -e /etc/instanton.ld.so.cache ]; then chmod g+w /etc/ld.so.cache; fi \
163160
&& chown -R 1001:0 /home/default \
164-
&& chmod -R g+rw /home/default
161+
&& chmod -R g+rw /home/default \
162+
&& mkdir -p /opt/ibm/links \
163+
&& chown -R 1001:0 /opt/ibm/links \
164+
&& chmod -R g+rw /opt/ibm/links \
165+
&& mkdir -p /opt/ibm/logs \
166+
&& chown -R 1001:0 /opt/ibm/logs \
167+
&& chmod -R g+rw /opt/ibm/logs \
168+
&& mkdir -p /serviceability \
169+
&& chown -R 1001:0 /serviceability \
170+
&& chmod -R g+rw /serviceability
171+
172+
USER 1001
173+
RUN ln -s /opt/ibm/logs /opt/ibm/links/logs
174+
USER root
175+
RUN ln -s /opt/ibm/links/logs /logs
165176

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

ga/latest/kernel/Dockerfile.ubuntu.ibmjava8

+16-5
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,7 @@ COPY helpers/ /opt/ibm/helpers/
112112
COPY fixes/ /opt/ibm/fixes/
113113

114114
# Create symlinks && set permissions for non-root user
115-
RUN mkdir /logs \
116-
&& mkdir /etc/wlp \
115+
RUN mkdir /etc/wlp \
117116
&& mkdir -p /opt/ibm/wlp/usr/shared/resources/lib.index.cache \
118117
&& mkdir -p /home/default \
119118
&& mkdir /output \
@@ -136,12 +135,24 @@ RUN mkdir /logs \
136135
&& chmod -R g+rw /opt/ibm/wlp/usr \
137136
&& chown -R 1001:0 /opt/ibm/wlp/output \
138137
&& chmod -R g+rw /opt/ibm/wlp/output \
139-
&& chown -R 1001:0 /logs \
140-
&& chmod -R g+rw /logs \
141138
&& chown -R 1001:0 /etc/wlp \
142139
&& chmod -R g+rw /etc/wlp \
143140
&& chown -R 1001:0 /home/default \
144-
&& chmod -R g+rw /home/default
141+
&& chmod -R g+rw /home/default \
142+
&& mkdir -p /opt/ibm/links \
143+
&& chown -R 1001:0 /opt/ibm/links \
144+
&& chmod -R g+rw /opt/ibm/links \
145+
&& mkdir -p /opt/ibm/logs \
146+
&& chown -R 1001:0 /opt/ibm/logs \
147+
&& chmod -R g+rw /opt/ibm/logs \
148+
&& mkdir -p /serviceability \
149+
&& chown -R 1001:0 /serviceability \
150+
&& chmod -R g+rw /serviceability
151+
152+
USER 1001
153+
RUN ln -s /opt/ibm/logs /opt/ibm/links/logs
154+
USER root
155+
RUN ln -s /opt/ibm/links/logs /logs
145156

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

ga/latest/kernel/Dockerfile.ubuntu.openjdk11

+16-5
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,7 @@ COPY helpers/ /opt/ibm/helpers/
107107
COPY fixes/ /opt/ibm/fixes/
108108

109109
# Create symlinks && set permissions for non-root user
110-
RUN mkdir /logs \
111-
&& mkdir /etc/wlp \
110+
RUN mkdir /etc/wlp \
112111
&& mkdir -p /opt/ibm/wlp/usr/shared/resources/lib.index.cache \
113112
&& mkdir -p /home/default \
114113
&& mkdir /output \
@@ -131,12 +130,24 @@ RUN mkdir /logs \
131130
&& chmod -R g+rw /opt/ibm/wlp/usr \
132131
&& chown -R 1001:0 /opt/ibm/wlp/output \
133132
&& chmod -R g+rw /opt/ibm/wlp/output \
134-
&& chown -R 1001:0 /logs \
135-
&& chmod -R g+rw /logs \
136133
&& chown -R 1001:0 /etc/wlp \
137134
&& chmod -R g+rw /etc/wlp \
138135
&& chown -R 1001:0 /home/default \
139-
&& chmod -R g+rw /home/default
136+
&& chmod -R g+rw /home/default \
137+
&& mkdir -p /opt/ibm/links \
138+
&& chown -R 1001:0 /opt/ibm/links \
139+
&& chmod -R g+rw /opt/ibm/links \
140+
&& mkdir -p /opt/ibm/logs \
141+
&& chown -R 1001:0 /opt/ibm/logs \
142+
&& chmod -R g+rw /opt/ibm/logs \
143+
&& mkdir -p /serviceability \
144+
&& chown -R 1001:0 /serviceability \
145+
&& chmod -R g+rw /serviceability
146+
147+
USER 1001
148+
RUN ln -s /opt/ibm/logs /opt/ibm/links/logs
149+
USER root
150+
RUN ln -s /opt/ibm/links/logs /logs
140151

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

ga/latest/kernel/Dockerfile.ubuntu.openjdk17

+16-5
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,7 @@ COPY helpers/ /opt/ibm/helpers/
107107
COPY fixes/ /opt/ibm/fixes/
108108

109109
# Create symlinks && set permissions for non-root user
110-
RUN mkdir /logs \
111-
&& mkdir /etc/wlp \
110+
RUN mkdir /etc/wlp \
112111
&& mkdir -p /opt/ibm/wlp/usr/shared/resources/lib.index.cache \
113112
&& mkdir -p /home/default \
114113
&& mkdir /output \
@@ -131,12 +130,24 @@ RUN mkdir /logs \
131130
&& chmod -R g+rw /opt/ibm/wlp/usr \
132131
&& chown -R 1001:0 /opt/ibm/wlp/output \
133132
&& chmod -R g+rw /opt/ibm/wlp/output \
134-
&& chown -R 1001:0 /logs \
135-
&& chmod -R g+rw /logs \
136133
&& chown -R 1001:0 /etc/wlp \
137134
&& chmod -R g+rw /etc/wlp \
138135
&& chown -R 1001:0 /home/default \
139-
&& chmod -R g+rw /home/default
136+
&& chmod -R g+rw /home/default \
137+
&& mkdir -p /opt/ibm/links \
138+
&& chown -R 1001:0 /opt/ibm/links \
139+
&& chmod -R g+rw /opt/ibm/links \
140+
&& mkdir -p /opt/ibm/logs \
141+
&& chown -R 1001:0 /opt/ibm/logs \
142+
&& chmod -R g+rw /opt/ibm/logs \
143+
&& mkdir -p /serviceability \
144+
&& chown -R 1001:0 /serviceability \
145+
&& chmod -R g+rw /serviceability
146+
147+
USER 1001
148+
RUN ln -s /opt/ibm/logs /opt/ibm/links/logs
149+
USER root
150+
RUN ln -s /opt/ibm/links/logs /logs
140151

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

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

+6
Original file line numberDiff line numberDiff line change
@@ -155,5 +155,11 @@ elif [[ ! -z "$WLP_CHECKPOINT" ]]; then
155155
checkpoint.sh "$TMP_CHECKPOINT"
156156
else
157157
# The default is to just exec the supplied CMD
158+
if [[ ! -z "$SERVICEABILITY_NAMESPACE" ]] && [[ ! -z $HOSTNAME ]]; then
159+
SERVICEABILITY_FOLDER="/serviceability/$SERVICEABILITY_NAMESPACE/$HOSTNAME"
160+
mkdir -p $SERVICEABILITY_FOLDER
161+
rm -f /opt/ibm/links/logs
162+
ln -s $SERVICEABILITY_FOLDER /opt/ibm/links/logs
163+
fi
158164
exec "$@"
159165
fi

0 commit comments

Comments
 (0)