diff --git a/README.md b/README.md index 543b7b4..8723f38 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,8 @@ Docker Images are avaiable on [ghcr.io](https://github.com/beardedio/terraria/pk * vanilla-1.4.3.6 [(containers/vanilla/1.4.3.6/Dockerfile)](https://github.com/beardedio/terraria/blob/master/containers/vanilla/1.4.3.6/Dockerfile) * vanilla-1.4.2.3 [(containers/vanilla/1.4.2.3/Dockerfile)](https://github.com/beardedio/terraria/blob/master/containers/vanilla/1.4.2.3/Dockerfile) * vanilla-1.4.1.2 [(containers/vanilla/1.4.1.2/Dockerfile)](https://github.com/beardedio/terraria/blob/master/containers/vanilla/1.4.1.2/Dockerfile) -* tshock-5.1.3, tshock-latest [(containers/tshock/5.1.3/Dockerfile)](https://github.com/beardedio/terraria/blob/master/containers/tshock/5.1.3/Dockerfile) +* tshock-5.2.0, tshock-latest [(containers/tshock/5.2.0/Dockerfile)](https://github.com/beardedio/terraria/blob/master/containers/tshock/5.2.0/Dockerfile) +* tshock-5.1.3 [(containers/tshock/5.1.3/Dockerfile)](https://github.com/beardedio/terraria/blob/master/containers/tshock/5.1.3/Dockerfile) * tshock-5.1.2 [(containers/tshock/5.1.2/Dockerfile)](https://github.com/beardedio/terraria/blob/master/containers/tshock/5.1.2/Dockerfile) * tshock-5.1.1 [(containers/tshock/5.1.1/Dockerfile)](https://github.com/beardedio/terraria/blob/master/containers/tshock/5.1.1/Dockerfile) * tshock-5.0.0 [(containers/tshock/5.0.0/Dockerfile)](https://github.com/beardedio/terraria/blob/master/containers/tshock/5.0.0/Dockerfile) diff --git a/containers/tshock/5.2.0/Dockerfile b/containers/tshock/5.2.0/Dockerfile new file mode 100644 index 0000000..bfe60b3 --- /dev/null +++ b/containers/tshock/5.2.0/Dockerfile @@ -0,0 +1,44 @@ +FROM mcr.microsoft.com/dotnet/runtime:6.0 + +# Update and install needed utils +RUN apt-get update && \ + apt-get upgrade -y && \ + apt-get install -y curl nuget vim zip && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +# Create symbolic link to ServerLog.txt +RUN mkdir /config /tshock && \ + touch /config/ServerLog.txt && \ + ln -s /config/ServerLog.txt /tshock/ServerLog.txt && \ + rm -rf /config + +# fix for favorites.json error +RUN favorites_path="/root/My Games/Terraria" && mkdir -p "$favorites_path" && echo "{}" > "$favorites_path/favorites.json" + +RUN cd /tmp && \ + curl -sL https://github.com/Pryaxis/TShock/releases/download/v5.2.0/TShock-5.2-for-Terraria-1.4.4.9-linux-x64-Release.zip --output tshock_release.zip && \ + unzip tshock_release.zip -d /tmp/tshock && \ + cd /tmp/tshock && \ + mkdir ./untar && tar -xf *.tar -C ./untar && \ + cd $(find . -type f -name TShock.Server -printf '%h\n') && \ + mv ./* /tshock/ && \ + rm -R /tmp/* + +COPY run-tshock.sh /tshock/run.sh + +# Metadata +ARG VCS_REF +LABEL org.label-schema.vcs-ref=$VCS_REF +LABEL org.label-schema.vcs-url="https://github.com/beardedio/terraria" +LABEL org.opencontainers.image.source=https://github.com/beardedio/terraria +LABEL org.opencontainers.image.licenses=MIT +LABEL org.opencontainers.image.description="Tshock Terraria Server - Version 5.2.0" +LABEL TSHOCK_VERSION=5.2.0 + +# Allow for external data +VOLUME ["/config", "/tshock/ServerPlugins"] + +# Run the server +WORKDIR /tshock +ENTRYPOINT ["./run.sh"] diff --git a/containers/tshock/5.2.0/run-tshock.sh b/containers/tshock/5.2.0/run-tshock.sh new file mode 100755 index 0000000..0ded5b7 --- /dev/null +++ b/containers/tshock/5.2.0/run-tshock.sh @@ -0,0 +1,16 @@ +#!/bin/bash +set -euo pipefail + +CMD="./TShock.Server -configpath /config -worldpath /config -worldselectpath /config -logpath /config" + +# Pass in world if set +if [ "${world:-null}" != null ]; then + if [ ! -f "/config/$world" ]; then + echo "World file does not exist! Quitting..." + exit 1 + fi + CMD="$CMD -world /config/$world" +fi + +echo "Starting container, CMD: $CMD $@" +exec $CMD $@ diff --git a/containers/tshock/latest b/containers/tshock/latest index 935851a..7cbea07 100644 --- a/containers/tshock/latest +++ b/containers/tshock/latest @@ -1 +1 @@ -5.1.3 \ No newline at end of file +5.2.0 \ No newline at end of file