ich777 / docker-steamcmd-server

Simple Dockerfile that installs steamcmd and a selected game server
121 stars 98 forks source link

Package install fails #13

Closed SteindelSE closed 2 years ago

SteindelSE commented 2 years ago

Issues: Step 3: apt-get -y install --no-install-recommends lib32gcc1 lib32stdc++6 lib32stdc++6 ends in failure: E: Package 'lib32gcc1' has no installation candidate

Recreate: git clone https://github.com/ich777/docker-steamcmd-server.git docker build -t user/game .

ich777 commented 2 years ago

What do you want to build exactly? I have updated the baseimage to Debian Bullseye and some packages changed slightly and I haven't got time yet to rebuild and check if all containers work after the update. You have two options:

Please look in the branch valheim or stn they are both updated and running Debian Bullseye as the baseimage.

EDIT: Updated the master branch with the appropriate package, should now build just fine.

SteindelSE commented 2 years ago

I made the change

What do you want to build exactly?

Survive The Nights server. I actually found your repositories because you mentioned to someone you would look into making a docker image for it. I thought I'd try to use the base work you did here and just modify the scripts to update and run the survive the nights stuff instead.

EDIT: Updated the master branch with the appropriate package, should now build just fine.

I made the change to my Dockerfile that you made in the commit and it did work. However, my /serverdata/serverfiles directory is empty. I'm sure that's something I messed up in the start.sh or start-server.sh.

start.sh

#!/bin/bash
echo "---Checking if UID: ${UID} matches user---"
usermod -u ${UID} ${USER}
echo "---Checking if GID: ${GID} matches user---"
usermod -g ${GID} ${USER}
echo "---Setting umask to ${UMASK}---"
umask ${UMASK}

echo "---Starting...---"
chown -R root:${GID} /opt/scripts
chmod -R 750 /opt/scripts
chown -R ${UID}:${GID} ${DATA_DIR}

term_handler() {
        kill -SIGTERM "$killpid"
        wait "$killpid" -f 2>/dev/null
        exit 143;
}

trap 'kill ${!}; term_handler' SIGTERM
su ${USER} -c "/opt/scripts/start-server.sh" &
killpid="$!"
while true
do
        wait $killpid
        exit 0;
done

start-server.sh:

#!/bin/bash
if [ ! -f ${STEAMCMD_DIR}/steamcmd.sh ]; then
    echo "SteamCMD not found!"
    wget -q -O ${STEAMCMD_DIR}/steamcmd_linux.tar.gz http://media.steampowered.com/client/steamcmd_linux.tar.gz
    tar --directory ${STEAMCMD_DIR} -xvzf /serverdata/steamcmd/steamcmd_linux.tar.gz
    rm ${STEAMCMD_DIR}/steamcmd_linux.tar.gz
fi

${STEAMCMD_DIR}/steamcmd.sh \
+login anonymous \
+quit

echo "---Update Server---"
if [ "${VALIDATE}" == "true" ]; then
    echo "---Validating installation---"
    ${STEAMCMD_DIR}/steamcmd.sh \
    +login anonymous \
    +force_install_dir ${SERVER_DIR} \
    +app_update ${GAME_ID} validate \
    +quit
else
    ${STEAMCMD_DIR}/steamcmd.sh \
    +login anonymous \
    +force_install_dir ${SERVER_DIR} \
    +app_update ${GAME_ID} \
    +quit
fi

echo "---Prepare Server---"
if [ ! -f ${DATA_DIR}/.steam/sdk32/steamclient.so ]; then
        if [ ! -d ${DATA_DIR}/.steam ]; then
        mkdir ${DATA_DIR}/.steam
    fi
        if [ ! -d ${DATA_DIR}/.steam/sdk32 ]; then
        mkdir ${DATA_DIR}/.steam/sdk32
    fi
    cp -R ${STEAMCMD_DIR}/linux32/* ${DATA_DIR}/.steam/sdk32/
fi
chmod -R ${DATA_PERM} ${DATA_DIR}
echo "---Server ready---"

echo "---Start Server---"
cd ${SERVER_DIR}
${SERVER_DIR}/Linux_Server_x64

Don't feel obligated to correct this for me. I haven't solved linking the config file up yet either since I can't see the directory structure for the server files.

ich777 commented 2 years ago

@SteindelSE yesterday I've created the container. It's actually the stn branch. If you use unRAID it's already in the CA App since yesterday. ;)

SteindelSE commented 2 years ago

@SteindelSE yesterday I've created the container. It's actually the stn branch.

Epic! Thank you! If I might make a small suggestion the README should mention that the branches are available (if it already does, ignore me). You have done SO MANY games. My hat is off to you! Excellent Work!