From 60a88f9d6559cbe664edbd73ffd6aea986b6cb9d Mon Sep 17 00:00:00 2001 From: Baikov Dmitrii <44803026+D-Baykov@users.noreply.github.com> Date: Thu, 9 Apr 2020 13:08:31 +0300 Subject: [PATCH] BJ-795: Add Dockerfile with OpenJDK 14 and jemalloc (#19) --- src/main/resources/Dockerfile | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/main/resources/Dockerfile diff --git a/src/main/resources/Dockerfile b/src/main/resources/Dockerfile new file mode 100644 index 0000000..a6aa5e9 --- /dev/null +++ b/src/main/resources/Dockerfile @@ -0,0 +1,28 @@ +# @dockerfile.Template@ +FROM openjdk:14-slim +MAINTAINER @project.maintainer@ + +ENV MALLOC_ARENA_MAX 2 + +RUN apt-get update && \ + apt-get install libjemalloc2 && \ + echo "/usr/lib/x86_64-linux-gnu/libjemalloc.so.2" > /etc/ld.so.preload && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +COPY @artifactId@-@version@.jar /opt/@artifactId@/@artifactId@.jar + +CMD [ "java", "-Xmx256m", \ + "-XX:-TieredCompilation", \ + "-XX:OnOutOfMemoryError=kill %p", \ + "-XX:+HeapDumpOnOutOfMemoryError", \ + "-jar", "/opt/@artifactId@/@artifactId@.jar" ] + +EXPOSE @exposed.ports@ + +LABEL com.rbkmoney.@artifactId@.parent=service-java \ + com.rbkmoney.@artifactId@.parent_tag=openjdk-14-slim \ + com.rbkmoney.@artifactId@.commit_id=@git.commit.id@ \ + com.rbkmoney.@artifactId@.branch=@git.branch@ + +WORKDIR /opt/@artifactId@