Dockerfile 1.1 KB

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