From 403284cc537bc8a2f72a0c87327b217bd5695549 Mon Sep 17 00:00:00 2001 From: Zorua162 <55893520+Zorua162@users.noreply.github.com> Date: Mon, 15 Apr 2024 07:48:04 +0100 Subject: [PATCH] [skip-ci] Add the ability to be able to use different platforms with the example Dockerfile (#2723) --- Docker/Dockerfile | 4 ++++ Docker/start-latest.sh | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Docker/Dockerfile b/Docker/Dockerfile index f8a5b485..3e42aed8 100644 --- a/Docker/Dockerfile +++ b/Docker/Dockerfile @@ -5,6 +5,10 @@ FROM mcr.microsoft.com/dotnet/sdk:6.0 # Then replace the with a version of your choice (Example: MCC_VERSION=20220817-29) #ENV MCC_VERSION= +# IF you want to use a specific platform then specific the ENV MCC_PLATFORM +# For example to use arm set the environment variable: MCC_PLATFORM=linux-arm64 +# `docker run -e MCC_PLATFORM=linux-arm64 -it localhost/minecraft-console-client` + # Copy over the script and give it execution permissions COPY start-latest.sh /opt/start-latest.sh RUN chmod +x /opt/start-latest.sh diff --git a/Docker/start-latest.sh b/Docker/start-latest.sh index 02d4532b..d94d8f00 100644 --- a/Docker/start-latest.sh +++ b/Docker/start-latest.sh @@ -2,6 +2,8 @@ cd /opt/data || exit 1 +echo "platform is ${MCC_PLATFORM}" + if [ -e "./MinecraftClient" -a -n "$MCC_SKIP_REDOWNLOAD" ]; then echo "Skip re-download MinecraftClient" else @@ -15,7 +17,7 @@ else echo "Donwloading MinecraftClient for ${RELEASE_TAG}" # Download the specified build or the latest one - curl -L https://github.com/MCCTeam/Minecraft-Console-Client/releases/download/${RELEASE_TAG}/MinecraftClient-linux.zip --output MinecraftClient-linux.zip + curl -L https://github.com/MCCTeam/Minecraft-Console-Client/releases/download/${RELEASE_TAG}/MinecraftClient-${MCC_PLATFORM:=linux}.zip --output MinecraftClient-linux.zip # Unzip it unzip MinecraftClient-linux.zip