Dockerfile 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. FROM openjdk:8-jre-alpine
  2. WORKDIR /home/minecraft
  3. # ADD launch.sh /home/minecraft/launch.sh
  4. # ADD https://github.com/itzg/rcon-cli/releases/download/1.3/rcon-cli_linux_amd64 /usr/local/bin/rcon-cli
  5. # This allows me to talk to Minecraft server
  6. ADD ./rcon-cli_linux_amd64 /usr/local/bin/rcon-cli
  7. # RUN apk add --no-cache su-exec python python-dev py2-pip tini bash \
  8. RUN apk add --no-cache su-exec python python-dev py2-pip bash \
  9. && addgroup -g 1000 minecraft \
  10. && adduser -D -u 1000 -G minecraft -h /home/minecraft minecraft \
  11. && pip install --no-cache-dir mcstatus \
  12. && apk del python-dev \
  13. && rm -rf /var/cache/apk/*
  14. ## rm -rf /root/.cache
  15. ADD launch.sh /launch.sh
  16. # && chown minecraft:minecraft /home/minecraft/*
  17. # Oddly, mcstatus localhost ping fails/unable to resolve hostname.
  18. HEALTHCHECK CMD mcstatus 127.0.0.1 ping
  19. EXPOSE 25565 25575
  20. VOLUME ["/home/minecraft"]
  21. # ENTRYPOINT [ "tini", "--" ]
  22. # CMD ["/launch-minecraft.sh"]
  23. CMD ["/launch.sh"]
  24. ENV UID=1000 GIU=1000 \
  25. SERVER=server.jar \
  26. JVM_XX_OPTS="-XX:+UseG1GC" MEMORY="1G"