Skip to content

Commit 759b5a6

Browse files
authored
Include and output image.properties (#570)
1 parent be0a795 commit 759b5a6

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,9 @@ jobs:
5757
${{ steps.meta.outputs.labels }}
5858
manymine.enable=true
5959
pull: true
60+
build-args: |
61+
BUILDTIME=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
62+
VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
63+
REVISION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
6064
cache-from: type=gha
6165
cache-to: type=gha,mode=max

Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,12 @@ ENV VERSION=LATEST \
5656
SERVER_PORT=19132
5757

5858
HEALTHCHECK --start-period=1m CMD /usr/local/bin/mc-monitor status-bedrock --host 127.0.0.1 --port $SERVER_PORT
59+
60+
ARG BUILDTIME=local
61+
ARG VERSION=local
62+
ARG REVISION=local
63+
COPY <<EOF /etc/image.properties
64+
buildtime=${BUILDTIME}
65+
version=${VERSION}
66+
revision=${REVISION}
67+
EOF

bedrock-entry.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ set -eo pipefail
66
: "${PREVIEW:=false}"
77
# Both net and net-secondary hostnames work
88
: "${DOWNLOAD_LINKS_URL:=https://net-secondary.web.minecraft-services.net/api/v1.0/download/links}"
9+
: "${USE_BOX64:=true}"
910

1011
function isTrue() {
1112
[[ "${1,,}" =~ ^(true|on|1)$ ]] && return 0
@@ -96,6 +97,8 @@ function lookupVersion() {
9697
fi
9798
}
9899

100+
echo "Image info: $(paste -d, -s /etc/image.properties)"
101+
99102
if [[ ${DEBUG^^} == TRUE ]]; then
100103
set -x
101104
curlArgs=(-v)
@@ -309,7 +312,7 @@ if isTrue "${ENABLE_SSH}"; then
309312
fi
310313

311314
echo "Starting Bedrock server..."
312-
if [[ -f /usr/local/bin/box64 ]] ; then
315+
if [[ -f /usr/local/bin/box64 ]] && isTrue "${USE_BOX64}" ; then
313316
exec mc-server-runner "${mcServerRunnerArgs[@]}" box64 ./"$SERVER"
314317
else
315318
exec mc-server-runner "${mcServerRunnerArgs[@]}" ./"$SERVER"

0 commit comments

Comments
 (0)