docker-minecraft-server/Dockerfile

19 lines
481 B
Docker
Raw Permalink Normal View History

ARG DOCKER_IMAGE
FROM ${DOCKER_IMAGE}
ARG VERSION_ID
ARG VERSION_SHA1
ENV MINECRAFT_VERSION=${VERSION_ID}
ENV INIT_MEMORY="512M"
ENV MAX_MEMORY="2G"
WORKDIR /server
# Copy server file and verify checksum
VOLUME [ "/server" ]
COPY versions/${VERSION_ID}/server.jar /server.jar
COPY eula.txt /server/
RUN echo -n "${VERSION_SHA1} /server.jar" | sha1sum -c -
# Run server
EXPOSE 25565
2023-01-27 12:09:04 +01:00
ENTRYPOINT ["java", "-Xms${INIT_MEMORY}", "-Xmx${MAX_MEMORY}", "-jar", "/server.jar", "--nogui"]