BJ-795: Add Dockerfile with OpenJDK 14 and jemalloc (#19)

This commit is contained in:
Baikov Dmitrii 2020-04-09 13:08:31 +03:00 committed by GitHub
parent dcbc857acc
commit 60a88f9d65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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@