Dockerfile 860 B

123456789101112131415161718192021222324
  1. FROM openjdk:8-alpine
  2. WORKDIR /opt/
  3. ENV MIN_MEM=1 MAX_MEM=16
  4. ARG JAR=https://launcher.mojang.com/v1/objects/bb2b6b1aefcd70dfd1892149ac3a215f6c636b07/server.jar
  5. # download+unpack & move configs to 1 folder
  6. # this allows for less volumes
  7. # ty @Roemer for the idea
  8. RUN apk add curl && \
  9. curl -sSL $JAR -o server.jar && \
  10. apk del curl && \
  11. echo "eula=true" > eula.txt && \
  12. mkdir config && \
  13. touch config/server.properties config/ops.json config/whitelist.json config/banned-ips.json config/banned-players.json && \
  14. ln -s config/server.properties server.properties && \
  15. ln -s config/ops.json ops.json && \
  16. ln -s config/whitelist.json whitelist.json && \
  17. ln -s config/banned-ips.json banned-ips.json && \
  18. ln -s config/banned-players.json banned-players.json
  19. CMD java -Xms${MIN_MEM}G -Xmx${MAX_MEM}G -jar server.jar nogui