Dockerfile 846 B

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