From 140de255f0903e3ec809cd6af8feb15c610db7e8 Mon Sep 17 00:00:00 2001 From: Alexandru Giurgiu Date: Fri, 3 Mar 2017 15:37:24 +0200 Subject: [PATCH] switched to the msd-java base image, which allows settings the java options via the JAVA_OPTS environment variable --- docker/shipping/Dockerfile | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/docker/shipping/Dockerfile b/docker/shipping/Dockerfile index 250d2de..e3ef392 100644 --- a/docker/shipping/Dockerfile +++ b/docker/shipping/Dockerfile @@ -1,17 +1,4 @@ -FROM java:openjdk-8-alpine - -ENV SERVICE_USER=myuser \ - SERVICE_UID=10001 \ - SERVICE_GROUP=mygroup \ - SERVICE_GID=10001 - -RUN addgroup -g ${SERVICE_GID} ${SERVICE_GROUP} && \ - adduser -g "${SERVICE_NAME} user" -D -H -G ${SERVICE_GROUP} -s /sbin/nologin -u ${SERVICE_UID} ${SERVICE_USER} && \ - apk add --update libcap && \ - mkdir /lib64 && \ - ln -s /usr/lib/jvm/java-1.8-openjdk/jre/lib/amd64/server/libjvm.so /lib/libjvm.so && \ - ln -s /usr/lib/jvm/java-1.8-openjdk/lib/amd64/jli/libjli.so /lib/libjli.so && \ - setcap 'cap_net_bind_service=+ep' $(readlink -f $(which java)) +FROM weaveworksdemos/msd-java:latest WORKDIR /usr/src/app COPY *.jar ./app.jar @@ -34,4 +21,5 @@ LABEL org.label-schema.vendor="Weaveworks" \ org.label-schema.vcs-ref="${COMMIT}" \ org.label-schema.schema-version="1.0" -ENTRYPOINT ["java","-Djava.security.egd=file:/dev/urandom","-jar","./app.jar", "--port=80"] +ENV JAVA_OPTS "-Djava.security.egd=file:/dev/urandom" +ENTRYPOINT ["/usr/local/bin/java.sh","-jar","./app.jar", "--port=80"]