Compare commits

...

6 Commits

5 changed files with 31 additions and 86 deletions

View File

@@ -4,19 +4,18 @@ LABEL org.opencontainers.image.authors="admin@minenet.at"
LABEL org.opencontainers.image.source="https://github.com/ich777/docker-steamcmd-server" LABEL org.opencontainers.image.source="https://github.com/ich777/docker-steamcmd-server"
RUN apt-get update && \ RUN apt-get update && \
apt-get -y install --no-install-recommends lib32gcc-s1 lib32stdc++6 lib32z1 screen xvfb winbind && \ apt-get -y install --no-install-recommends lib32gcc-s1 lib32stdc++6 lib32z1 winbind && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
ENV DATA_DIR="/serverdata" ENV DATA_DIR="/serverdata"
ENV STEAMCMD_DIR="${DATA_DIR}/steamcmd" ENV STEAMCMD_DIR="${DATA_DIR}/steamcmd"
ENV SERVER_DIR="${DATA_DIR}/serverfiles" ENV SERVER_DIR="${DATA_DIR}/serverfiles"
ENV GAME_ID="2430930" ENV GAME_ID="2857200"
ENV MAP="TheIsland_WP" ENV SERVER_NAME="Abiotic Factor Docker"
ENV SERVER_NAME="ASA Docker" ENV SERVER_PWD="Docker"
ENV SRV_PWD="Docker" ENV GAME_PARAMS="-log"
ENV SRV_ADMIN_PWD="adminDocker" ENV GAME_PORT=7777
ENV GAME_PARAMS="?Port=7777" ENV QUERY_PORT=27015
ENV GAME_PARAMS_EXTRA="-WinLiveMaxPlayers=20 -server -log -NoBattlEye"
ENV VALIDATE="" ENV VALIDATE=""
ENV UMASK=000 ENV UMASK=000
ENV UID=99 ENV UID=99

View File

@@ -1,9 +1,5 @@
# SteamCMD in Docker optimized for Unraid # SteamCMD in Docker optimized for Unraid
This Docker will download and install SteamCMD. It will also install ARK:SurvivalAscended and run it (Normal server startup of ARK can take a long time!). This Docker will download and install SteamCMD. It will also install Abiotic Factor and run it.
**WARNING:** You have to set the value vm.max_map_count to at least 256000 on the host as root with the command:
`echo 265000 > /proc/sys/vm/max_map_count`
To make that value persistent on Unraid please use a User Script that runs on startup or with the command from above or put it in your `go` file.
ATTENTION: First Startup can take very long since it downloads the gameserver files! ATTENTION: First Startup can take very long since it downloads the gameserver files!
@@ -11,40 +7,38 @@ Update Notice: Simply restart the container if a newer version of the game is av
You can also run multiple servers with only one SteamCMD directory! You can also run multiple servers with only one SteamCMD directory!
## Example Env params for CS:Source ## Example Env params
| Name | Value | Example | | Name | Value | Example |
| --- | --- | --- | | --- | --- | --- |
| STEAMCMD_DIR | Folder for SteamCMD | /serverdata/steamcmd | | STEAMCMD_DIR | Folder for SteamCMD | /serverdata/steamcmd |
| SERVER_DIR | Folder for gamefile | /serverdata/serverfiles | | SERVER_DIR | Folder for gamefile | /serverdata/serverfiles |
| GAME_ID | The GAME_ID that the container downloads at startup. If you want to install a static or beta version of the game change the value to: '2430930 -beta YOURBRANCH' (without quotes, replace YOURBRANCH with the branch or version you want to install). | 2430930 | | GAME_ID | The GAME_ID that the container downloads at startup. If you want to install a static or beta version of the game change the value to: '2857200 -beta YOURBRANCH' (without quotes, replace YOURBRANCH with the branch or version you want to install). | 2857200 |
| MAP | Enter your preferred map name | TheIsland_WP | | SERVER_NAME | Your server name goes here | Abiotic Factor Docker |
| SERVER_NAME | Your server name goes here | ASA Docker | | SERVER_PWD | Your server password goes here | Docker |
| SRV_PWD | Your server password goes here | Docker | | GAME_PARAMS | Enter your game parameters | -log |
| SRV_ADMIN_PWD | Your server admin password goes here | adminDocker | | GAME_PORT | Enter your preferred game port | 7777 |
| GAME_PARAMS | Enter your game parameters seperated with ? and start with a ? | ?Port=7777?MaxPlayers=20 | | QUERY_PORT | Enter your preferred query port | 27015 |
| GAME_PARAMS_EXTRA | Enter your Extra Game Parameters seperated with a space and - | -server -log -NoBattlEye |
| UID | User Identifier | 99 | | UID | User Identifier | 99 |
| GID | Group Identifier | 100 | | GID | Group Identifier | 100 |
| VALIDATE | Validates the game data | blank | | VALIDATE | Validates the game data | blank |
| USERNAME | Leave blank for anonymous login | blank | | USERNAME | Leave blank for anonymous login | blank |
| PASSWRD | Leave blank for anonymous login | blank | | PASSWRD | Leave blank for anonymous login | blank |
## Run example for CS:Source ## Run example
``` ```
docker run --name ARKSurvivalAscended -d \ docker run --name AbioticFactor -d \
-p 7777:7777/udp \ -p 7777:7777/udp -p 27015:27015/udp\
--env 'GAME_ID=2430930' \ --env 'GAME_ID=2857200' \
--env 'MAP=TheIsland_WP' \ --env 'SERVER_NAME=Abiotic Factor Docker' \
--env 'SERVER_NAME=ASA Docker' \ --env 'SERVER_PWD=Docker' \
--env 'SRV_PWD=Docker' \ --env 'GAME_PARAMS=-log' \
--env 'SRV_ADMIN_PWD=adminDocker' \ --env 'GAME_PORT=7777' \
--env 'GAME_PARAMS=?Port=7777?MaxPlayers=20' \ --env 'QUERY_PORT=27015' \
--env 'GAME_PARAMS_EXTRA=-server -log -NoBattlEye' \
--env 'UID=99' \ --env 'UID=99' \
--env 'GID=100' \ --env 'GID=100' \
--volume /path/to/steamcmd:/serverdata/steamcmd \ --volume /path/to/steamcmd:/serverdata/steamcmd \
--volume /path/to/arksa:/serverdata/serverfiles \ --volume /path/to/abioticfactor:/serverdata/serverfiles \
ich777/steamcmd:asa ich777/steamcmd:abioticfactor
``` ```
This Docker was mainly edited for better use with Unraid, if you don't use Unraid you should definitely try it! This Docker was mainly edited for better use with Unraid, if you don't use Unraid you should definitely try it!

View File

@@ -54,31 +54,6 @@ else
fi fi
fi fi
echo "---Checking the maximum map count per process...---"
CUR_MAX_MAP_COUNT=$(cat /proc/sys/vm/max_map_count)
if [[ $CUR_MAX_MAP_COUNT -ge 256000 ]]; then
echo "---Maximum map count per process OK...---"
echo "---Current map count per process: $CUR_MAX_MAP_COUNT---"
else
echo
echo "+---ATTENTION---ATTENTION---ATTENTION---ATTENTION---ATTENTION---"
echo "| Maximum map count per process too low, currently: $CUR_MAX_MAP_COUNT"
echo "| Please set the value to at least '256000' on the host and"
echo "| restart the container afterwards."
echo "|"
echo "| You can change the value by executing this command on the host"
echo "| as root:"
echo
echo "echo 265000 > /proc/sys/vm/max_map_count"
echo
echo "| You can make that persistent by using a User Script that runs"
echo "| on startup or putting this line in your go file."
echo "+---ATTENTION---ATTENTION---ATTENTION---ATTENTION---ATTENTION---"
echo
echo "---Putting container into sleep mode!---"
sleep infinity
fi
export WINEARCH=win64 export WINEARCH=win64
export WINEPREFIX=/serverdata/serverfiles/WINE64 export WINEPREFIX=/serverdata/serverfiles/WINE64
export WINEDEBUG=-all export WINEDEBUG=-all
@@ -103,25 +78,10 @@ chmod -R ${DATA_PERM} ${DATA_DIR}
echo "---Server ready---" echo "---Server ready---"
echo "---Start Server---" echo "---Start Server---"
if [ ! -f ${SERVER_DIR}/ShooterGame/Binaries/Win64/ArkAscendedServer.exe ]; then if [ ! -f ${SERVER_DIR}/AbioticFactor/Binaries/Win64/AbioticFactorServer-Win64-Shipping.exe ]; then
echo "---Something went wrong, can't find the executable, putting container into sleep mode!---" echo "---Something went wrong, can't find the executable, putting container into sleep mode!---"
sleep infinity sleep infinity
else else
cd ${SERVER_DIR}/ShooterGame/Binaries/Win64 cd ${SERVER_DIR}/AbioticFactor/Binaries/Win64
wine64 ArkAscendedServer.exe ${MAP}?listen?SessionName="${SERVER_NAME}"?ServerPassword="${SRV_PWD}"${GAME_PARAMS}?ServerAdminPassword="${SRV_ADMIN_PWD}" ${GAME_PARAMS_EXTRA} & wine64 ${SERVER_DIR}/AbioticFactor/Binaries/Win64/AbioticFactorServer-Win64-Shipping.exe ${GAME_PARAMS} -oldconsole -useperfthreads -NoAsyncLoadingThread -PORT=${GAME_PORT} -QUERYPORT=${QUERY_PORT} -ServerPassword="${SERVER_PWD}" -SteamServerName="${SERVER_NAME}"
echo "Waiting for logs..."
ATTEMPT=0
sleep 2
while [ ! -f "${SERVER_DIR}/ShooterGame/Saved/Logs/ShooterGame.log" ]; do
((ATTEMPT++))
if [ $ATTEMPT -eq 10 ]; then
echo "No log files found after 20 seconds, putting container into sleep mode!"
sleep infinity
else
sleep 2
echo "Waiting for logs..."
fi
done
/opt/scripts/start-watchdog.sh &
tail -n 9999 -f ${SERVER_DIR}/ShooterGame/Saved/Logs/ShooterGame.log
fi fi

View File

@@ -1,8 +0,0 @@
#!/bin/bash
killpid="$(pidof ArkAscendedServer.exe)"
while true
do
tail --pid=$killpid -f /dev/null
kill "$(pidof tail)"
exit 0
done

View File

@@ -26,8 +26,8 @@ chown -R ${UID}:${GID} ${DATA_DIR}
echo "---Starting...---" echo "---Starting...---"
term_handler() { term_handler() {
kill -SIGTERM $(pidof ArkAscendedServer.exe) kill -SIGINT $(pidof AbioticFactorServer-Win64-Shipping.exe)
tail --pid=$(pidof ArkAscendedServer.exe) -f 2>/dev/null tail --pid=$(pidof AbioticFactorServer-Win64-Shipping.exe) -f 2>/dev/null
exit 143; exit 143;
} }