-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from kir68k/srcds-64bit
Added 64-bit and 32-bit tags
- Loading branch information
Showing
5 changed files
with
152 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
#!/bin/bash | ||
BUILD_PATH=$(echo ${DOCKERFILE_PATH}| sed 's#/#..#g' | sed 's#[a-zA-Z0-9]\+#/#g' | cut -c 2- ) | ||
|
||
docker build --target=bookworm-base -f $(basename ${DOCKERFILE_PATH}) -t $DOCKER_REPO:latest -t $DOCKER_REPO:base ${BUILD_PATH}. | ||
docker build --target=bookworm-metamod -f $(basename ${DOCKERFILE_PATH}) -t $DOCKER_REPO:metamod ${BUILD_PATH}. | ||
docker build --target=bookworm-sourcemod -f $(basename ${DOCKERFILE_PATH}) -t $DOCKER_REPO:sourcemod ${BUILD_PATH}. | ||
BUILD_PATH=$(echo ${DOCKERFILE_PATH} | sed 's#/#..#g' | sed 's#[a-zA-Z0-9]\+#/#g' | cut -c 2- ) | ||
|
||
docker build --target=bookworm-base -f "x32/$(basename ${DOCKERFILE_PATH})" -t $DOCKER_REPO:latest -t $DOCKER_REPO:latest-x32 -t $DOCKER_REPO:base-x32 -t $DOCKER_REPO:base "${BUILD_PATH}". | ||
docker build --target=bookworm-metamod -f "x32/$(basename ${DOCKERFILE_PATH})" -t $DOCKER_REPO:metamod -t $DOCKER_REPO:metamod-x32 "${BUILD_PATH}". | ||
docker build --target=bookworm-sourcemod -f "x32/$(basename ${DOCKERFILE_PATH})" -t $DOCKER_REPO:sourcemod -t $DOCKER_REPO:sourcemod-x32 "${BUILD_PATH}". | ||
|
||
docker build --target=bookworm-base -f "x64/$(basename ${DOCKERFILE_PATH})" -t $DOCKER_REPO:latest-x64 -t $DOCKER_REPO:base-x64 ${BUILD_PATH}. | ||
docker build --target=bookworm-metamod -f "x64/$(basename ${DOCKERFILE_PATH})" -t $DOCKER_REPO:metamod-x64 ${BUILD_PATH}. | ||
docker build --target=bookworm-sourcemod -f "x64/$(basename ${DOCKERFILE_PATH})" -t $DOCKER_REPO:sourcemod-x64 ${BUILD_PATH}. | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
########################################################### | ||
# Dockerfile that builds a TF2 Gameserver | ||
########################################################### | ||
FROM cm2network/steamcmd:root AS build_stage | ||
|
||
LABEL maintainer="[email protected]" | ||
|
||
ENV STEAMAPPID 232250 | ||
ENV STEAMAPP tf | ||
ENV STEAMAPPDIR "${HOMEDIR}/${STEAMAPP}-dedicated" | ||
|
||
COPY "etc/entry_x64.sh" "${HOMEDIR}/entry_x64.sh" | ||
COPY "etc/cfg" "${STEAMAPPDIR}/${STEAMAPP}/cfg/" | ||
|
||
RUN set -x \ | ||
# Install, update & upgrade packages | ||
&& apt-get update \ | ||
&& apt-get install -y --no-install-recommends --no-install-suggests \ | ||
wget=1.21.3-1+b2 \ | ||
ca-certificates=20230311 \ | ||
zlib1g=1:1.2.13.dfsg-1 \ | ||
libncurses5=6.4-4 \ | ||
libbz2-1.0=1.0.8-5+b1 \ | ||
libtinfo5=6.4-4 \ | ||
libcurl3-gnutls=7.88.1-10+deb12u5 \ | ||
&& mkdir -p "${STEAMAPPDIR}" \ | ||
# Create autoupdate config | ||
&& { \ | ||
echo '@ShutdownOnFailedCommand 1'; \ | ||
echo '@NoPromptForPassword 1'; \ | ||
echo 'force_install_dir '"${STEAMAPPDIR}"''; \ | ||
echo 'login anonymous'; \ | ||
echo 'app_update '"${STEAMAPPID}"''; \ | ||
echo 'quit'; \ | ||
} > "${HOMEDIR}/${STEAMAPP}_update.txt" \ | ||
&& chmod +x "${HOMEDIR}/entry_x64.sh" \ | ||
&& chown -R "${USER}:${USER}" "${HOMEDIR}/entry_x64.sh" "${STEAMAPPDIR}" "${HOMEDIR}/${STEAMAPP}_update.txt" \ | ||
# Clean up | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
FROM build_stage AS bookworm-base | ||
|
||
ENV SRCDS_FPSMAX=300 \ | ||
SRCDS_TICKRATE=66 \ | ||
SRCDS_PORT=27015 \ | ||
SRCDS_TV_PORT=27020 \ | ||
SRCDS_NET_PUBLIC_ADDRESS="0" \ | ||
SRCDS_IP="0" \ | ||
SRCDS_MAXPLAYERS=16 \ | ||
SRCDS_TOKEN=0 \ | ||
SRCDS_RCONPW="changeme" \ | ||
SRCDS_PW="changeme" \ | ||
SRCDS_STARTMAP="ctf_2fort" \ | ||
SRCDS_REGION=3 \ | ||
SRCDS_HOSTNAME="New \"${STEAMAPP}\" Server" \ | ||
SRCDS_WORKSHOP_START_MAP=0 \ | ||
SRCDS_HOST_WORKSHOP_COLLECTION=0 \ | ||
SRCDS_WORKSHOP_AUTHKEY="" \ | ||
SRCDS_CFG="server.cfg" \ | ||
SRCDS_MAPCYCLE="mapcycle.txt" \ | ||
SRCDS_SECURED=1 | ||
|
||
# Switch to user | ||
USER ${USER} | ||
|
||
WORKDIR ${HOMEDIR} | ||
|
||
CMD ["bash", "entry_x64.sh"] | ||
|
||
# Expose ports | ||
EXPOSE 27015/tcp \ | ||
27015/udp \ | ||
27020/udp | ||
|
||
FROM bookworm-base AS bookworm-metamod | ||
|
||
ENV METAMOD_VERSION 1.12 | ||
|
||
FROM bookworm-metamod AS bookworm-sourcemod | ||
|
||
ENV SOURCEMOD_VERSION 1.12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/bin/bash | ||
mkdir -p "${STEAMAPPDIR}" || true | ||
|
||
bash "${STEAMCMDDIR}/steamcmd.sh" +force_install_dir "${STEAMAPPDIR}" \ | ||
+login anonymous \ | ||
+app_update "${STEAMAPPID}" \ | ||
+quit | ||
|
||
# Are we in a metamod container and is the metamod folder missing? | ||
if [ ! -z "$METAMOD_VERSION" ] && [ ! -d "${STEAMAPPDIR}/${STEAMAPP}/addons/metamod" ]; then | ||
LATESTMM=$(wget -qO- https://mms.alliedmods.net/mmsdrop/"${METAMOD_VERSION}"/mmsource-latest-linux) | ||
wget -qO- https://mms.alliedmods.net/mmsdrop/"${METAMOD_VERSION}"/"${LATESTMM}" | tar xvzf - -C "${STEAMAPPDIR}/${STEAMAPP}" | ||
fi | ||
|
||
# Are we in a sourcemod container and is the sourcemod folder missing? | ||
if [ ! -z "$SOURCEMOD_VERSION" ] && [ ! -d "${STEAMAPPDIR}/${STEAMAPP}/addons/sourcemod" ]; then | ||
LATESTSM=$(wget -qO- https://sm.alliedmods.net/smdrop/"${SOURCEMOD_VERSION}"/sourcemod-latest-linux) | ||
wget -qO- https://sm.alliedmods.net/smdrop/"${SOURCEMOD_VERSION}"/"${LATESTSM}" | tar xvzf - -C "${STEAMAPPDIR}/${STEAMAPP}" | ||
fi | ||
|
||
# Is the config missing? | ||
if [ ! -f "${STEAMAPPDIR}/${STEAMAPP}/cfg/server.cfg" ]; then | ||
# Change hostname on first launch (you can comment this out if it has done its purpose) | ||
sed -i -e 's/{{SERVER_HOSTNAME}}/'"${SRCDS_HOSTNAME}"'/g' "${STEAMAPPDIR}/${STEAMAPP}/cfg/server.cfg" | ||
fi | ||
|
||
# Believe it or not, if you don't do this srcds_run shits itself | ||
cd "${STEAMAPPDIR}" | ||
|
||
SERVER_SECURITY_FLAG=""; | ||
|
||
if [ "$SRCDS_SECURED" -eq 0 ]; then | ||
SERVER_SECURITY_FLAG="-insecure"; | ||
fi | ||
|
||
bash "${STEAMAPPDIR}/srcds_run_64" -game "${STEAMAPP}" -console -autoupdate \ | ||
-steam_dir "${STEAMCMDDIR}" \ | ||
-steamcmd_script "${HOMEDIR}/${STEAMAPP}_update.txt" \ | ||
-usercon \ | ||
+fps_max "${SRCDS_FPSMAX}" \ | ||
-tickrate "${SRCDS_TICKRATE}" \ | ||
-port "${SRCDS_PORT}" \ | ||
+tv_port "${SRCDS_TV_PORT}" \ | ||
+clientport "${SRCDS_CLIENT_PORT}" \ | ||
+maxplayers "${SRCDS_MAXPLAYERS}" \ | ||
+map "${SRCDS_STARTMAP}" \ | ||
+sv_setsteamaccount "${SRCDS_TOKEN}" \ | ||
+rcon_password "${SRCDS_RCONPW}" \ | ||
+sv_password "${SRCDS_PW}" \ | ||
+sv_region "${SRCDS_REGION}" \ | ||
-ip "${SRCDS_IP}" \ | ||
-authkey "${SRCDS_WORKSHOP_AUTHKEY}" \ | ||
+servercfgfile "${SRCDS_CFG}" \ | ||
+mapcyclefile "${SRCDS_MAPCYCLE}" \ | ||
${SERVER_SECURITY_FLAG} |