0
0
mirror of https://github.com/CloudburstMC/Nukkit.git synced 2024-12-11 21:11:01 +00:00
nukkit/Dockerfile.arm64
PetteriM1 047d00a703
Docker fixes & improvements (#2202)
- Changed gradlew line endings to fix Docker build, fixes #2157
- Use more up to date JDK Docker image
- Expose UDP port by default
- Don't ask for language on first Docker run
- No git submodules are used anymore
2024-11-17 09:29:50 +01:00

50 lines
1.2 KiB
Docker

# This Dockerfile uses Docker Multi-Stage Builds
# See https://docs.docker.com/engine/userguide/eng-image/multistage-build/
# Requires Docker v17.05
# Use OpenJDK JDK image for intermiediate build
FROM --platform=linux/arm64 eclipse-temurin:8-jdk-jammy AS build
# Build from source and create artifact
WORKDIR /src
COPY gradlew *.gradle.kts /src/
COPY src /src/src
COPY .git /src/.git
COPY gradle /src/gradle
RUN ./gradlew shadowJar
# Use OpenJDK JRE image for runtime
FROM --platform=linux/arm64 eclipse-temurin:8-jdk-jammy AS run
# Copy artifact from build image
COPY --from=build /src/target/nukkit-1.0-SNAPSHOT.jar /app/nukkit.jar
# Create minecraft user
RUN useradd --user-group \
--no-create-home \
--home-dir /data \
--shell /usr/sbin/nologin \
minecraft
# Ports
EXPOSE 19132/tcp
EXPOSE 19132/udp
RUN mkdir /data && mkdir /home/minecraft
RUN chown -R minecraft:minecraft /app /data /home/minecraft
# User and group to run as
USER minecraft:minecraft
# Volumes
VOLUME /data /home/minecraft
# Set runtime workdir
WORKDIR /data
# Run app
ENTRYPOINT ["java"]
CMD [ "-jar", "/app/nukkit.jar", "--language", "eng" ]