Skip to content

Commit

Permalink
[skip-ci] Add the ability to be able to use different platforms with …
Browse files Browse the repository at this point in the history
…the example Dockerfile (#2723)
  • Loading branch information
Zorua162 authored Apr 15, 2024
1 parent 2fe376e commit 403284c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ FROM mcr.microsoft.com/dotnet/sdk:6.0
# Then replace the <version> with a version of your choice (Example: MCC_VERSION=20220817-29)
#ENV MCC_VERSION=<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
Expand Down
4 changes: 3 additions & 1 deletion Docker/start-latest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 403284c

Please sign in to comment.