0
0
mirror of https://github.com/CloudburstMC/Nukkit.git synced 2024-11-11 11:29:31 +00:00
nukkit/Dockerfile.arm64
2023-02-25 18:25:55 +00:00

32 lines
1.1 KiB
Docker

FROM arm64v8/openjdk:8-jdk-slim AS build
WORKDIR /usr/local/src/nukkit
COPY src /usr/local/src/nukkit/src
COPY gradlew *.gradle.kts .gitmodules /src/
COPY src /src/src
COPY .git /src/.git
COPY gradle /src/gradle
RUN git submodule update --init && \
./gradlew shadowJar
FROM arm64v8/openjdk:8-jre-slim AS run
LABEL maintainer="Chris Fordham <chris@fordham.id.au>"
COPY --from=build /usr/local/src/nukkit/target/nukkit-1.0-SNAPSHOT.jar /opt/nukkit/nukkit.jar
COPY nukkit.yml.default /etc/opt/nukkit/nukkit.yml
RUN useradd --user-group \
--no-create-home \
--home-dir /var/opt/nukkit \
--shell /usr/sbin/nologin \
minecraft && \
mkdir -p /var/opt/nukkit && \
chown -R minecraft /opt/nukkit /var/opt/nukkit /etc/opt/nukkit/nukkit.yml && \
ln -sfv /etc/opt/nukkit/nukkit.yml /var/opt/nukkit/nukkit.yml && \
apt-get -y update && \
apt-get -y install lsof && \
rm -rf /var/lib/apt/lists/*
USER minecraft
VOLUME /etc/opt/nukkit /var/opt/nukkit /opt/nukkit
EXPOSE 19132
WORKDIR /var/opt/nukkit
ENTRYPOINT ["java"]
CMD [ "-jar", "/opt/nukkit/nukkit.jar" ]