From 3982c03b7e7f4c3917fa28ca173bb722ee107823 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Wed, 16 May 2018 00:00:14 +0200 Subject: [PATCH] Update to new downloader Signed-off-by: Knut Ahlers --- Dockerfile | 41 +++++++++++++++++++++++++++++++++++++---- start.sh | 11 ++++++++--- 2 files changed, 45 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4722fd5..630ce32 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,47 @@ FROM debian +ENV LC_ALL=C \ + LC_CTYPE=C \ + LANG=C + RUN set -ex \ && dpkg --add-architecture i386 \ && apt-get update \ - && apt-get install -y mailutils postfix curl wget file bzip2 gzip unzip bsdmainutils python util-linux tmux lib32gcc1 libstdc++6 libstdc++6:i386 \ - && adduser --disabled-password rustserver + && apt-get install -y \ + bc \ + binutils \ + bsdmainutils \ + bzip2 \ + ca-certificates \ + curl \ + file \ + gzip \ + lib32gcc1 \ + lib32z1 \ + libstdc++6 \ + libstdc++6:i386 \ + locales \ + mailutils \ + postfix \ + procps \ + python \ + tmux \ + unzip \ + util-linux \ + wget \ + && adduser --disabled-password rustserver \ + && echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen \ + && locale-gen \ + && update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 -ADD https://gameservermanagers.com/dl/rustserver /opt/rustserver +WORKDIR /tmp + +ADD https://linuxgsm.com/dl/linuxgsm.sh /tmp/linuxgsm.sh RUN set -ex \ - && chmod 755 /opt/rustserver + && chmod 0644 linuxgsm.sh \ + && su -c "bash linuxgsm.sh rustserver" rustserver \ + && chmod 0755 rustserver \ + && mv /tmp/rustserver /opt/rustserver USER rustserver WORKDIR /home/rustserver diff --git a/start.sh b/start.sh index 0e07937..252d624 100755 --- a/start.sh +++ b/start.sh @@ -1,11 +1,16 @@ #!/bin/bash +set -euxo pipefail # Copy default rustserver script from Linux Game Server Managers when not present -[ -e /home/rustserver/rustserver ] || cp /opt/rustserver /home/rustserver/rustserver +[ -e /home/rustserver/rustserver ] || { + cp /opt/rustserver /home/rustserver/rustserver + chmod 0755 /home/rustserver/rustserver +} /home/rustserver/rustserver "$@" +set +x # Keep Docker container running until gameserver process is not longer available -while ( pgrep RustDedicated >/dev/null 2>&1 ); do - sleep 1 +while (pgrep RustDedicated >/dev/null 2>&1); do + sleep 1 done