From 6c69374ca5a0bbf04b7ef0985090fc5feeb3e88c Mon Sep 17 00:00:00 2001 From: Sandy Martel Date: Sat, 7 Jan 2023 00:55:11 +1100 Subject: [PATCH] Arm64 support (#291) --- Dockerfile | 14 +++++++++++++- bedrock-entry.sh | 6 +++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index eb12cd3..0693edf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM debian -# ARCH is only set to avoid repetition in Dockerfile since the binary download only supports amd64 +# ARCH is only set to avoid repetition in Dockerfile, use --build-arg ARCH=arm64 for arm cpu ARG ARCH=amd64 ARG APT_UPDATE=20210112 @@ -13,6 +13,18 @@ RUN apt-get update && \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* +# Instal box64 on arm +RUN if [ "$ARCH" = "arm64" ] ; then \ + apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y debian-keyring && \ + curl -L https://ryanfortner.github.io/box64-debs/box64.list -o /etc/apt/sources.list.d/box64.list && \ + curl -L https://ryanfortner.github.io/box64-debs/KEY.gpg | gpg --dearmor > /usr/share/keyrings/box64-debs-archive-keyring.gpg && \ + apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y box64 \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* ;\ + fi + EXPOSE 19132/udp VOLUME ["/data"] diff --git a/bedrock-entry.sh b/bedrock-entry.sh index 9d80ec1..e0b1342 100755 --- a/bedrock-entry.sh +++ b/bedrock-entry.sh @@ -159,4 +159,8 @@ set-property --file server.properties --bulk /etc/bds-property-definitions.json export LD_LIBRARY_PATH=. echo "Starting Bedrock server..." -exec ./bedrock_server-${VERSION} +if [ -f /usr/local/bin/box64 ] ; then + exec box64 ./bedrock_server-${VERSION} +else + exec ./bedrock_server-${VERSION} +fi