diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md new file mode 100644 index 0000000..087f43d --- /dev/null +++ b/DEVELOPMENT.md @@ -0,0 +1,23 @@ +## Using development copy of mc-image-helper + +In the cloned copy of [`mc-image-helper`](https://github.com/itzg/mc-image-helper), create an up-to-date snapshot build of the tgz distribution using: + +```shell +./gradlew distTar +``` + +**NOTE** The distribution's version will be `0.0.0--SNAPSHOT` + +Assuming Java 18 or newer: + +```shell +cd build/distributions +jwebserver -b 0.0.0.0 -p 8008 +``` + +```shell +--build-arg MC_HELPER_VERSION=1.8.1-SNAPSHOT \ +--build-arg MC_HELPER_BASE_URL=http://host.docker.internal:8008 +``` + +Now the image can be built like normal, and it will install mc-image-helper from the locally built copy. diff --git a/Dockerfile b/Dockerfile index 5280403..3afa309 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,7 @@ -FROM debian +# using focal, rather than jammy to align with latest in +# https://github.com/itzg/docker-minecraft-server/blob/master/.github/workflows/build-multiarch.yml +ARG BASE_IMAGE=eclipse-temurin:17-jre-focal +FROM ${BASE_IMAGE} # hook into docker BuildKit --platform support # see https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope @@ -38,12 +41,18 @@ RUN chmod +x /usr/local/bin/easy-add RUN easy-add --var version=0.4.0 --var app=entrypoint-demoter --file {{.app}} --from https://github.com/itzg/{{.app}}/releases/download/v{{.version}}/{{.app}}_{{.version}}_linux_${TARGETARCH}.tar.gz -RUN easy-add --var version=0.1.1 --var app=set-property --file {{.app}} --from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_linux_${TARGETARCH}.tar.gz - RUN easy-add --var version=1.6.2 --var app=restify --file {{.app}} --from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_linux_${TARGETARCH}.tar.gz RUN easy-add --var version=0.5.0 --var app=mc-monitor --file {{.app}} --from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_linux_${TARGETARCH}.tar.gz +ARG MC_HELPER_VERSION=1.35.0 +ARG MC_HELPER_BASE_URL=https://github.com/itzg/mc-image-helper/releases/download/${MC_HELPER_VERSION} +# used for cache busting local copy of mc-image-helper +ARG MC_HELPER_REV=1 +RUN curl -fsSL ${MC_HELPER_BASE_URL}/mc-image-helper-${MC_HELPER_VERSION}.tgz \ + | tar -C /usr/share -zxf - \ + && ln -s /usr/share/mc-image-helper-${MC_HELPER_VERSION}/bin/mc-image-helper /usr/bin + COPY *.sh /opt/ COPY property-definitions.json /etc/bds-property-definitions.json diff --git a/bedrock-entry.sh b/bedrock-entry.sh index 274fb07..253d9c9 100755 --- a/bedrock-entry.sh +++ b/bedrock-entry.sh @@ -19,6 +19,7 @@ function isTrue() { function lookupVersion() { platform=${1:?Missing required platform indicator} + # shellcheck disable=SC2034 for i in {1..3}; do DOWNLOAD_URL=$(restify --user-agent=itzg/minecraft-bedrock-server --headers "accept-language:*" --attribute=data-platform="${platform}" "${downloadPage}" 2> restify.err | jq -r '.[0].href' || echo '') if [[ ${DOWNLOAD_URL} ]]; then @@ -183,7 +184,7 @@ if [[ -v ALLOW_LIST_USERS || -v WHITE_LIST_USERS ]]; then export WHITE_LIST ALLOW_LIST fi -set-property --file server.properties --bulk /etc/bds-property-definitions.json +mc-image-helper set-properties --definitions /etc/bds-property-definitions.json server.properties export LD_LIBRARY_PATH=. diff --git a/docs/Example of tcpdump monitoring discovery broadcast packet.png b/docs/Example of tcpdump monitoring discovery broadcast packet.png new file mode 100644 index 0000000..a64458b Binary files /dev/null and b/docs/Example of tcpdump monitoring discovery broadcast packet.png differ diff --git a/property-definitions.json b/property-definitions.json index 2f14cc6..1486a97 100644 --- a/property-definitions.json +++ b/property-definitions.json @@ -48,8 +48,7 @@ "allowed": ["true","false"] }, "white-list": { - "env": "WHITE_LIST", - "allowed": ["true","false"] + "remove": true }, "allow-list": { "env": "ALLOW_LIST",