Skip to content
This repository was archived by the owner on Oct 7, 2021. It is now read-only.

Commit 3e16fda

Browse files
committed
fix: Update the dockerfile apm config so it works correctly
Making a few changes so the APM config works correctly. There were a few issues: 1. the changes to server.env were not valid and likely never worked as expected. It relied on doing variable expansion which isn't supported in server.env 1. it didn't work with the Liberty container in non-root mode which is best practice 1. I'm suspicious of the -Xmx setting the heap to 728Mb. If the docker container has a smaller memory limit this will break. To make this work I've put the server.env changes in as a docker env var and for the jvm args I've specified them using JVM_ARGS. I haven't moved the -Xmx setting. I think it is probably better to set the heap usage to use a % of available memory. I think there is a way to do this, but I think this might make sense to put in the base image.
1 parent 727d60e commit 3e16fda

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

generators/dockertools/templates/java/Dockerfile.template

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ COPY /build/wlp/usr/servers/defaultServer /config/
1616
{{/has}}
1717
# Install required features if not present, install APM Data Collector
1818
RUN installUtility install --acceptLicense defaultServer && installUtility install --acceptLicense apmDataCollector-7.4
19-
RUN /opt/ibm/wlp/usr/extension/liberty_dc/bin/config_liberty_dc.sh -silent /opt/ibm/wlp/usr/extension/liberty_dc/bin/silent_config_liberty_dc.txt
19+
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/lib:/opt/ibm/wlp/usr/extension/liberty_dc/toolkit/lib/lx8266 \
20+
JVM_ARGS="$JVM_ARGS -agentlib:am_ibm_16=defaultServer -Xbootclasspath/p:/opt/ibm/wlp/usr/extension/liberty_dc/toolkit/lib/bcm-bootstrap.jar -Xverbosegclog:/logs/gc.log,1,10000 -verbosegc -Djava.security.policy=/opt/ibm/wlp/usr/extension/liberty_dc/itcamdc/etc/datacollector.policy -Dliberty.home=/opt/ibm/wlp"
21+
2022
# Upgrade to production license if URL to JAR provided
2123
ARG LICENSE_JAR_URL
2224
RUN \

test/test-dockertools.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,11 @@ describe('cloud-enablement:dockertools', function () {
306306
it('Dockerfile contains apmDataCollector-7.4', function () {
307307
assert.fileContent('Dockerfile', 'apmDataCollector-7.4');
308308
});
309-
it('Dockerfile contains config_liberty_dc.sh', function () {
310-
assert.fileContent('Dockerfile', 'config_liberty_dc.sh');
309+
it('Dockerfile contains LD_LIBRARY_PATH', function () {
310+
assert.fileContent('Dockerfile', 'LD_LIBRARY_PATH');
311+
});
312+
it('Dockerfile contains JVM_ARGS', function () {
313+
assert.fileContent('Dockerfile', 'JVM_ARGS');
311314
});
312315
it('Dockerfile-tools contains wlp path', function () {
313316
assert.fileContent('Dockerfile-tools', 'wlp/bin');

0 commit comments

Comments
 (0)