Skip to content

Commit

Permalink
add support for TShock on arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
85yago committed Apr 3, 2023
1 parent b68a2d4 commit d60e274
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-tshock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
with:
context: ./tshock
file: tshock/Dockerfile
platforms: linux/amd64
platforms: linux/amd64,linux/arm64
push: true
tags: |
ryshe/terraria:latest
Expand Down
24 changes: 17 additions & 7 deletions tshock/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
FROM alpine:3.16.3 AS base

RUN apk add --update-cache \
unzip
curl unzip

# add the bootstrap file
COPY bootstrap.sh /tshock/bootstrap.sh

ENV TSHOCKVERSION=v5.1.3
ENV TSHOCKZIP=TShock-5.1.3-for-Terraria-1.4.4.9-linux-x64-Release.zip

# Download and unpack TShock
ADD https://github.com/Pryaxis/TShock/releases/download/$TSHOCKVERSION/$TSHOCKZIP /
RUN unzip $TSHOCKZIP -d /tshock && \
tar -xvf /tshock/*.tar -C /tshock && \
rm $TSHOCKZIP && \
chmod +x /tshock/TShock.Server && \
RUN set -eux; \
arch="$(apk --print-arch)"; \
case "$arch" in \
'x86_64') \
export TSHOCKZIP='TShock-5.1.3-for-Terraria-1.4.4.9-linux-x64-Release.zip'; \
;; \
'aarch64') \
export TSHOCKZIP='TShock-5.1.3-for-Terraria-1.4.4.9-linux-arm64-Release.zip'; \
;; \
*) echo >&2 "error: unsupported architecture '$arch'."; exit 1 ;; \
esac; \
curl -L -o /$TSHOCKZIP https://github.com/Pryaxis/TShock/releases/download/$TSHOCKVERSION/$TSHOCKZIP; \
unzip $TSHOCKZIP -d /tshock ; \
tar -xvf /tshock/*.tar -C /tshock ; \
rm $TSHOCKZIP ; \
chmod +x /tshock/TShock.Server ; \
# add executable perm to bootstrap
chmod +x /tshock/bootstrap.sh

Expand Down

0 comments on commit d60e274

Please sign in to comment.