Fixed the Docker

This commit is contained in:
Milutinke 2022-08-19 21:22:54 +02:00
parent 5ae6699e5c
commit ec0f94a870
2 changed files with 26 additions and 11 deletions

View file

@ -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 <version> with a version of your choice (Example: MCC_VERSION=20220817-29)
#ENV MCC_VERSION=<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"]

View file

@ -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