-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
47 lines (36 loc) · 1.58 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
FROM alpine:3.16 as build
ARG PUBLICATION_SERVER_JAR=target/rpki-publication-server.jar
# Use /staging/data, since /app/../data is equal to /data and would be cleared
# by the tests.
RUN mkdir -p /staging/conf /staging/conf/ssl /staging/data/db /staging/data/logs /staging/data/rrdp
ADD . /app
COPY ${PUBLICATION_SERVER_JAR} /app/rpki-publication-server.jar
#
# Container picks up the artifact from './target/rpki-publication-server.jar'
#
WORKDIR /app
# could RUN sbt assembly or RUN 'set test in assembly := {}' clean assembly here,
# but we pick up the artifact instead.
RUN cp docker/publication-server-docker.conf /staging/conf/
# use gcr.io/distroless/java-debian10:11-debug if you want to be able to run a
# shell in the container (e.g. `docker run -it --entrypoint sh --rm <image>`)
FROM gcr.io/distroless/java-debian10:11
LABEL org.label-schema.vcs-ref="unknown"
COPY --from=build /staging/conf/ /conf/
COPY --from=build /staging/data/ /data/
COPY --from=build /app/rpki-publication-server.jar /app/
EXPOSE 7766
EXPOSE 7788
EXPOSE 5005
VOLUME ["/conf", "/data"]
#ENV JAVA_TOOL_OPTIONS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005"
ENV JAVA_TOOL_OPTIONS="-Djava.net.preferIPv4Stack=true \
-Djava.net.preferIPv4Addresses=true \
-Dapp.name=rpki-publication-server \
-Xms1g \
-Xmx4g \
-XX:+HeapDumpOnOutOfMemoryError \
-XX:HeapDumpPath=/data/dumps/pubserver-heap-dump.hprof \
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 \
-Dconfig.file=/conf/publication-server-docker.conf"
CMD ["/app/rpki-publication-server.jar"]