-
Notifications
You must be signed in to change notification settings - Fork 109
/
Copy pathDockerfile-jdk9
42 lines (34 loc) · 1.51 KB
/
Dockerfile-jdk9
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
###########################################
### Build Stage 1 ###
###########################################
FROM maven:3.8.6-openjdk-8-slim AS maven-builder
COPY ./resources/server /usr/src/app
WORKDIR /usr/src/app
RUN mvn clean package
###########################################
### Build Stage 2 ###
###########################################
FROM ghcr.io/qtc-de/remote-method-guesser/rmg-example-server:4.0-jdk9 AS jdk-builder
RUN set -ex \
&& mv /usr/lib/jvm/java-9-openjdk /jdk
###########################################
### Container Stage ###
###########################################
FROM alpine:latest
COPY ./resources/trust/store.p12 /opt/store.p12
COPY ./resources/scripts/start.sh /opt/start.sh
COPY ./resources/conf/policy /opt/policy
COPY --from=maven-builder /usr/src/app/target/rmg-example-server-*-jar-with-dependencies.jar /opt/example-server.jar
COPY --from=jdk-builder /jdk /usr/lib/jvm/java-9-openjdk
RUN set -ex \
&& ln -s /usr/lib/jvm/java-9-openjdk/bin/java /usr/bin/java \
&& chmod +x /opt/start.sh
ENV _JAVA_OPTIONS -Djava.rmi.server.hostname=iinsecure.example \
-Djavax.net.ssl.keyStorePassword=password \
-Djavax.net.ssl.keyStore=/opt/store.p12 \
-Djavax.net.ssl.keyStoreType=pkcs12 \
-Djava.rmi.server.useCodebaseOnly=false \
-Djava.security.policy=/opt/policy \
-Djava.rmi.server.codebase=http://iinsecure.example/well-hidden-development-folder/
EXPOSE 1090/tcp 1098/tcp 9010/tcp
CMD ["/opt/start.sh"]