From 63a6c7c9cdf106f6c591ae59a378a7ab38a73895 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Sat, 18 Feb 2017 16:38:29 +0100 Subject: [PATCH] Initial Signed-off-by: Knut Ahlers --- Dockerfile | 21 +++++++++++++++++++++ start.sh | 11 +++++++++++ 2 files changed, 32 insertions(+) create mode 100644 Dockerfile create mode 100755 start.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4722fd5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM debian + +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 + +ADD https://gameservermanagers.com/dl/rustserver /opt/rustserver +RUN set -ex \ + && chmod 755 /opt/rustserver + +USER rustserver +WORKDIR /home/rustserver + +ADD start.sh /opt/start.sh + +VOLUME /home/rustserver + +EXPOSE 28015/udp 28016 +ENTRYPOINT ["/opt/start.sh"] diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..0e07937 --- /dev/null +++ b/start.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +# Copy default rustserver script from Linux Game Server Managers when not present +[ -e /home/rustserver/rustserver ] || cp /opt/rustserver /home/rustserver/rustserver + +/home/rustserver/rustserver "$@" + +# Keep Docker container running until gameserver process is not longer available +while ( pgrep RustDedicated >/dev/null 2>&1 ); do + sleep 1 +done