@@ -42,16 +42,25 @@ COPY --from=compile --chown=1001:0 /work/config/ /config/
42
42
43
43
# 2d) Add the microprofile health feature configuration if it is not already defined in the user's configuration.
44
44
# This allows k8s to use the deployment's health probes.
45
- COPY --from=compile --chown=1001:0 /stack/ol/config/configDropins/defaults/liberty-stack-mpHealth.xml /config/configDropins/defaults
46
- RUN for FILE in /config/*.xml; do \
47
- if cat $FILE | sed '/<!--.*-->/d' | sed '/<!--/,/-->/d' \
48
- | grep -q '<feature>\s *mpHealth-[0-9]*.[0-9]*\s *</feature>\| <feature>\s *microProfile-[0-9]*.[0-9]*\s *</feature>' ; then \
49
- rm /config/configDropins/defaults/liberty-stack-mpHealth.xml; \
45
+ RUN mkdir -p /tmp/stack/config/configDropins/defaults
46
+ COPY --from=compile --chown=1001:0 /stack/ol/config/configDropins/defaults/ /tmp/stack/config/configDropins/defaults/
47
+
48
+ ARG ADD_MP_HEALTH=true
49
+ RUN if [ "$ADD_MP_HEALTH" = "true" ]; then \
50
+ /opt/ol/wlp/bin/server start; \
51
+ /opt/ol/wlp/bin/server stop; \
52
+ if ! grep "CWWKF0012I" /logs/messages.log | grep -q 'mpHealth-[0-9]*.[0-9]*\| microProfile-[0-9]*.[0-9]*' ; then \
53
+ echo "Missing mpHealth feature - adding config snippet" ; \
54
+ cp /tmp/stack/config/configDropins/defaults/liberty-stack-mpHealth.xml /config/configDropins/overrides; \
55
+ else \
56
+ echo "Found mpHealth feature - not adding config snippet" ; \
50
57
fi; \
51
- done
58
+ rm -rf /logs/*; \
59
+ elif [ "$ADD_MP_HEALTH" != "false" ]; then \
60
+ echo "Invalid ADD_MP_HEALTH value: $ADD_MP_HEALTH. Valid values are \" true\" | \" false\" " ; \
61
+ fi
52
62
53
- # This Dockerfile uses the Open Liberty "full" image. If this is changed to use the Open Liberty kernel-slim image, uncomment the line below to install all necessary features.
54
- # RUN features.sh
63
+ RUN rm -rf /tmp/stack
55
64
56
65
# 2e) Copy the application binary
57
66
COPY --from=compile --chown=1001:0 /work/outer-loop-app/target/*.[ew]ar /config/apps
0 commit comments