Skip to content

Commit 3c884a3

Browse files
authored
Fixed the Docker Image
Fixed the Docker image.
2 parents 09b1d06 + e6164cd commit 3c884a3

File tree

2 files changed

+26
-10
lines changed

2 files changed

+26
-10
lines changed

Docker/Dockerfile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1-
FROM mono:6.12.0
1+
# Using the .NET official image for .NET 6.0
2+
FROM mcr.microsoft.com/dotnet/sdk:6.0
23

4+
# If you want to use a specific build, un-comment the ENV MCC_VERSION line (remove the # from the start)
5+
# Then replace the <version> with a version of your choice (Example: MCC_VERSION=20220817-29)
6+
#ENV MCC_VERSION=<version>
7+
8+
# Copy over the script and give it execution permissions
39
COPY start-latest.sh /opt/start-latest.sh
10+
RUN chmod +x /opt/start-latest.sh
411

512
RUN apt-get update && \
6-
apt-get install -y jq && \
7-
mkdir /opt/data && \
8-
chmod +x /opt/start-latest.sh
13+
apt-get install -y unzip && \
14+
mkdir /opt/data
915

1016
ENTRYPOINT ["/bin/sh", "-c", "/opt/start-latest.sh"]

Docker/start-latest.sh

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,21 @@
22

33
cd /opt/data || exit 1
44

5-
# Get latest release tag
6-
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)
5+
# Use the provided version tag or get the latest release tag
6+
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)}
77

8-
# Download latest version
9-
curl -L https://github.com/MCCTeam/Minecraft-Console-Client/releases/download/${RELEASE_TAG}/MinecraftClient.exe --output MinecraftClient.exe
8+
# Delete the old build
9+
[ -e MinecraftClient-linux.zip ] && rm -- MinecraftClient-linux.zip
10+
[ -e MinecraftClient ] && rm -- MinecraftClient
1011

11-
# Start Client
12-
mono MinecraftClient.exe
12+
# Download the specified build or the latest one
13+
curl -L https://github.com/MCCTeam/Minecraft-Console-Client/releases/download/${RELEASE_TAG}/MinecraftClient-linux.zip --output MinecraftClient-linux.zip
14+
15+
# Unzip it
16+
unzip MinecraftClient-linux.zip
17+
18+
# Remove the ZIP
19+
rm -- MinecraftClient-linux.zip
20+
21+
# Start the Client
22+
./MinecraftClient

0 commit comments

Comments
 (0)