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:
jreichmann 2018-03-03 10:36:20 +01:00
commit 22bb490237
4 changed files with 31 additions and 0 deletions

12
Dockerfile Normal file
View 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"]

Binary file not shown.

View 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
}

View file