By default, automatically determine latest server version

This commit is contained in:
Geoff Bourne committed 2019-09-01 15:30:49 -05:00
1 parent 927203d4d6
commit ab4d2d7def
3 files changed
+24 -7

No files matched your search

+4 -1
View File
@@ -27,6 +27,9 @@ RUN easy-add --file entrypoint-demoter --from https://github.com/itzg/entrypoint
ARG SET_PROPERTY_VERSION=0.1.1
RUN easy-add --file set-property --from https://github.com/itzg/set-property/releases/download/${SET_PROPERTY_VERSION}/set-property_${SET_PROPERTY_VERSION}_linux_${ARCH}.tar.gz
ARG RESTIFY_VERSION=1.2.0
RUN easy-add --file restify --from https://github.com/itzg/restify/releases/download/${RESTIFY_VERSION}/restify_${RESTIFY_VERSION}_linux_amd64.tar.gz
COPY *.sh /opt/
COPY property-definitions.json /etc/bds-property-definitions.json
@@ -34,4 +37,4 @@ COPY property-definitions.json /etc/bds-property-definitions.json
# Available versions listed at
# https://minecraft.gamepedia.com/Bedrock_Edition_1.11.0
# https://minecraft.gamepedia.com/Bedrock_Edition_1.12.0
ENV VERSION=1.12
ENV VERSION=LATEST
+5 -2
View File
@@ -24,8 +24,11 @@ For Minecraft Java Edition you'll need to use this image instead:
- `EULA` (no default) : must be set to `TRUE` to
accept the [Minecraft End User License Agreement](https://minecraft.net/terms)
- `VERSION` (1.12) : can be set to a specific server version or just 1.11 or 1.12 to pick
the latest known version of each
- `VERSION` (`LATEST`) : can be set to a specific server version or the following special values can be used:
- `LATEST` : determines the latest version and can be used to auto-upgrade on container start
- `PREVIOUS` : uses the previously maintained major version. Useful when the mobile app is gradually being upgraded across devices
- `1.11` : the latest version of 1.11
- `1.12` : the latest version of 1.12
- `UID` (default derived from `/data` owner) : can be set to a specific user ID to run the
bedrock server process
- `GID` (default derived from `/data` owner) : can be set to a specific group ID to run the
+15 -4
View File
@@ -11,21 +11,32 @@ fi
set -e
case ${VERSION} in
1.11)
1.11|PREVIOUS)
VERSION=1.11.4.2
;;
1.12)
VERSION=1.12.0.28
;;
*)
DOWNLOAD_URL=$(restify --attribute=data-platform=serverBedrockLinux https://www.minecraft.net/en-us/download/server/bedrock/ | jq -r '.[0].href')
if [[ ${DOWNLOAD_URL} =~ http.*/.*-(.*)\.zip ]]; then
VERSION=${BASH_REMATCH[1]}
else
echo "Failed to process download URL ${DOWNLOAD_URL}"
exit 2
fi
;;
esac
if [ ! -f bedrock_server-${VERSION} ]; then
if [ ! -f "bedrock_server-${VERSION}" ]; then
if [[ ! ${DOWNLOAD_URL} ]]; then
DOWNLOAD_URL=https://minecraft.azureedge.net/bin-linux/bedrock-server-${VERSION}.zip
fi
TMP_ZIP=/tmp/$(basename ${DOWNLOAD_URL})
TMP_ZIP=/tmp/$(basename "${DOWNLOAD_URL}")
echo "Downloading Bedrock server ${VERSION} ..."
echo "Downloading Bedrock server version ${VERSION} ..."
curl -o ${TMP_ZIP} -fsSL ${DOWNLOAD_URL}
# remove only binaries to allow for an upgrade of those