From ec0f94a870b309e508ac8df6b11141b37b47c564 Mon Sep 17 00:00:00 2001 From: Milutinke Date: Fri, 19 Aug 2022 21:22:54 +0200 Subject: [PATCH] Fixed the Docker --- Docker/Dockerfile | 15 ++++++++++----- Docker/start-latest.sh | 22 ++++++++++++++++------ 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/Docker/Dockerfile b/Docker/Dockerfile index a2f09634..02a1db04 100644 --- a/Docker/Dockerfile +++ b/Docker/Dockerfile @@ -1,10 +1,15 @@ -FROM mono:6.12.0 +# Using the .NET official image for .NET 6.0 +FROM mcr.microsoft.com/dotnet/sdk:6.0 -COPY start-latest.sh /opt/start-latest.sh +# If you want to use a specific build, un-comment the ENV MCC_VERSION line (remove the # from the start) +# Then replace the with a version of your choice (Example: MCC_VERSION=20220817-29) +#ENV MCC_VERSION= + +# Copy over the script and give it execution permissions +COPY --chmod=0755 start-latest.sh /opt/start-latest.sh RUN apt-get update && \ - apt-get install -y jq && \ - mkdir /opt/data && \ - chmod +x /opt/start-latest.sh + apt-get install -y unzip && \ + mkdir /opt/data ENTRYPOINT ["/bin/sh", "-c", "/opt/start-latest.sh"] \ No newline at end of file diff --git a/Docker/start-latest.sh b/Docker/start-latest.sh index 9e2fb4df..6f158287 100644 --- a/Docker/start-latest.sh +++ b/Docker/start-latest.sh @@ -2,11 +2,21 @@ cd /opt/data || exit 1 -# Get latest release tag -RELEASE_TAG=$(curl -s -v https://github.com/MCCTeam/Minecraft-Console-Client/releases/latest 2>&1 | grep -i location: | tr -d '\r' | cut -d/ -f8) +# Use the provided version tag or get the latest release tag +RELEASE_TAG=${MCC_VERSION:-$(curl -s -v https://github.com/MCCTeam/Minecraft-Console-Client/releases/latest 2>&1 | grep -i location: | tr -d '\r' | cut -d/ -f8)} -# Download latest version -curl -L https://github.com/MCCTeam/Minecraft-Console-Client/releases/download/${RELEASE_TAG}/MinecraftClient.exe --output MinecraftClient.exe +# Delete the old build +[ -e MinecraftClient-linux.zip ] && rm -- MinecraftClient-linux.zip +[ -e MinecraftClient ] && rm -- MinecraftClient -# Start Client -mono MinecraftClient.exe +# 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 + +# Unzip it +unzip MinecraftClient-linux.zip + +# Remove the ZIP +rm -- MinecraftClient-linux.zip + +# Start the Client +./MinecraftClient