Add Dockerfile and rough container file structure
Added Dockerfile based on alpine:edge with the following packages: - curl - for downloading the server & querying for versions - jq - parsing JSON from bash Set up internal file structure of the container with scripts to download and run the server (unfinished)
This commit is contained in:
commit
22bb490237
12
Dockerfile
Normal file
12
Dockerfile
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
FROM alpine:edge
|
||||||
|
MAINTAINER Jona Reichmann
|
||||||
|
|
||||||
|
RUN apk update \
|
||||||
|
&& apk upgrade \
|
||||||
|
&& apk add \
|
||||||
|
curl
|
||||||
|
jq
|
||||||
|
|
||||||
|
ADD fsRoot /
|
||||||
|
|
||||||
|
CMD ["bash", "-c", "/opt/minecraft/entrypoint.sh"]
|
BIN
fsRoot/opt/minecraft/.downloadServer.sh.swp
Normal file
BIN
fsRoot/opt/minecraft/.downloadServer.sh.swp
Normal file
Binary file not shown.
19
fsRoot/opt/minecraft/downloadServer.sh
Normal file
19
fsRoot/opt/minecraft/downloadServer.sh
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
BASE_DOWNLOAD_URL="https://s3.amazonaws.com/Minecraft.Download/versions/"
|
||||||
|
VERSION_INFO_URL="https://launchermeta.mojang.com/mc/game/version_manifast.json"
|
||||||
|
|
||||||
|
function query_latest_release() {
|
||||||
|
curl -s "$VERSION_INFO_URL" | jq -r '.latest.release'
|
||||||
|
}
|
||||||
|
|
||||||
|
function query_latest_snapshot() {
|
||||||
|
curl -s "$VERSION_INFO_URL" | jq -r '.latest.snapshot'
|
||||||
|
}
|
||||||
|
|
||||||
|
function download_version() {
|
||||||
|
local version="$1"
|
||||||
|
local url="${BASE_DOWNLOAD_URL}${version}/minecraft_server.${version}.jar"
|
||||||
|
curl -s -o "minecraft_server.jar" $url
|
||||||
|
}
|
||||||
|
|
0
fsRoot/opt/minecraft/entrypoint.sh
Normal file
0
fsRoot/opt/minecraft/entrypoint.sh
Normal file
Loading…
Reference in a new issue