-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile-openjdk
33 lines (25 loc) · 946 Bytes
/
Dockerfile-openjdk
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
FROM alpine:3.16.3 AS prepare
# Copy the source to maven build
WORKDIR /work
COPY /target/libs /work/libs
COPY src/main/resources/default-nukkit.yml /work/nukkit.yml
COPY entrypoint.sh /work/entrypoint.sh
RUN apk add --no-cache wget && \
apk add --no-cache unzip && \
wget https://github.com/PowerNukkitX/PNX-CLI/releases/download/0.1.6/PNX-CLI-0.1.6.jar
# Final image
FROM khipu/openjdk17-alpine
LABEL author="CoolLoong"
WORKDIR /pnx
ENV language=eng
ENV memory=2G
COPY --from=prepare /work/libs /pnx/libs
COPY --from=prepare /work/PNX-CLI-0.1.6.jar /pnx/cli.jar
COPY --from=prepare /work/nukkit.yml /pnx/nukkit.yml
COPY --from=prepare /work/entrypoint.sh /pnx/entrypoint.sh
RUN mkdir -p /pnx/plugins /pnx/players /pnx/worlds && \
java -jar /pnx/cli.jar server -u --latest && \
java -jar /pnx/cli.jar comp -u graaljit
EXPOSE 19132/udp
VOLUME ["/pnx/plugins","/pnx/players","/pnx/worlds"]
ENTRYPOINT ["/pnx/entrypoint.sh"]