1
1
# Minecraft 1.11 Dockerfile - Example with notes
2
2
3
- # Use the offical Debian Docker image with a specified version tag, Jessie , so not all
3
+ # Use the offical Debian Docker image with a specified version tag, Stretch , so not all
4
4
# versions of Debian images are downloaded.
5
- FROM debian:jessie
5
+ FROM debian:stretch
6
6
7
7
MAINTAINER Michael Chiang <
[email protected] >
8
8
9
- # Drives which version we are going to install
10
- ENV MINECRAFT_VERSION 1.13.2
9
+ # Simple utility for download a specific version of the minecraft server.jar
10
+ ENV MINECRAFT_UTILITY https://github.com/marblenix/minecraft_downloader/releases/download/20190324-f1427be/minecraft_downloader_linux
11
+ # Version of minecraft to download
12
+ ENV MINECRAFT_VERSION latest
11
13
12
14
# Use APT (Advanced Packaging Tool) built in the Linux distro to download Java, a dependency
13
15
# to run Minecraft.
@@ -16,10 +18,11 @@ ENV MINECRAFT_VERSION 1.13.2
16
18
# Then we pull in all of our dependencies,
17
19
# Finally, we download the correct .jar file using wget
18
20
# .jar file fetched from the official page https://minecraft.net/en-us/download/server/
19
- RUN echo "deb http://http.debian.net/debian jessie-backports main" > /etc/apt/sources.list.d/jessie-backports.list; \
20
- apt-get -y update; \
21
- apt install -y -t jessie-backports openjdk-8-jre-headless ca-certificates-java wget; \
22
- wget -q https://launcher.mojang.com/v1/objects/3737db93722a9e39eeada7c27e7aca28b144ffa7/server.jar -O /minecraft_server.${MINECRAFT_VERSION}.jar;
21
+ RUN apt update; \
22
+ apt install -y default-jre ca-certificates-java curl; \
23
+ curl -sL "${MINECRAFT_UTILITY}" -o minecraft_downloader; \
24
+ chmod +x ./minecraft_downloader; \
25
+ ./minecraft_downloader -o minecraft_server_${MINECRAFT_VERSION}.jar;
23
26
# We do the above in a single line to reduce the number of layers in our container
24
27
25
28
# Sets working directory for the CMD instruction (also works for RUN, ENTRYPOINT commands)
@@ -31,4 +34,4 @@ VOLUME /data
31
34
EXPOSE 25565
32
35
33
36
# Automatically accept Minecraft EULA, and start Minecraft server
34
- CMD echo eula=true > /data/eula.txt && java -jar /minecraft_server. ${MINECRAFT_VERSION}.jar
37
+ CMD echo eula=true > /data/eula.txt && java -jar /minecraft_server_ ${MINECRAFT_VERSION}.jar
0 commit comments