From 67c1bd8a5782aa2254e6f5b3046373fb65338dd7 Mon Sep 17 00:00:00 2001 From: SNMetamorph Date: Sun, 6 Oct 2024 23:16:14 +0400 Subject: [PATCH] Updated Dockerfile to work with mainline engine --- Dockerfile | 72 ++++++++++++++++-------------------------------- lib/hlds.install | 8 ------ 2 files changed, 23 insertions(+), 57 deletions(-) delete mode 100644 lib/hlds.install diff --git a/Dockerfile b/Dockerfile index 9eeccd4..dc0b341 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,8 @@ -FROM debian:buster-slim +FROM debian:bookworm-slim ARG hlds_build=8308 ARG amxmod_version=1.8.2 ARG jk_botti_version=1.43 -ARG steamcmd_url=https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz ARG hlds_url="https://github.com/DevilBoy-eXe/hlds/releases/download/$hlds_build/hlds_build_$hlds_build.zip" ARG metamod_url="https://github.com/mittorn/metamod-p/releases/download/1/metamod.so" ARG amxmod_url="http://www.amxmodx.org/release/amxmodx-$amxmod_version-base-linux.tar.gz" @@ -11,67 +10,43 @@ ARG jk_botti_url="http://koti.kapsi.fi/jukivili/web/jk_botti/jk_botti-$jk_botti_ ENV XASH3D_BASEDIR=/opt/steam/xashds -# Fix warning: -# WARNING: setlocale('en_US.UTF-8') failed, using locale: 'C'. -# International characters may not work. -RUN apt-get update && apt-get install -y --no-install-recommends \ - locales=2.28-10 \ - && rm -rf /var/lib/apt/lists/* \ - && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 -ENV LANG en_US.utf8 -ENV LC_ALL en_US.UTF-8 - -# Fix error: -# Unable to determine CPU Frequency. Try defining CPU_MHZ. -# Exiting on SPEW_ABORT -ENV CPU_MHZ=2300 - RUN groupadd -r steam && useradd -r -g steam -m -d /opt/steam steam RUN usermod -a -G games steam RUN dpkg --add-architecture i386 RUN apt-get -y update && apt-get install -y --no-install-recommends \ - build-essential=12.6 \ - ca-certificates=20190110 \ - cmake=3.13.4-1 \ - curl=7.64.0-4+deb10u1 \ - git=1:2.20.1-2+deb10u3 \ - gnupg2=2.2.12-1+deb10u1 \ - g++-multilib=4:8.3.0-1 \ - lib32gcc1=1:8.3.0-6 \ - libstdc++6:i386=8.3.0-6 \ - python=2.7.16-1 \ - unzip=6.0-23+deb10u1 \ - xz-utils=5.2.4-1 \ - zip=3.0-11+b1 \ + build-essential \ + ca-certificates \ + curl \ + git \ + gnupg2 \ + g++-multilib \ + lib32gcc-s1 \ + libstdc++6 \ + python3 \ + unzip \ + xz-utils \ + zip \ && apt-get -y autoremove \ && rm -rf /var/lib/apt/lists/* -RUN git clone --recursive https://github.com/FWGS/xash3d \ - && mkdir -p xash3d/build -WORKDIR /xash3d/build -RUN cmake -DXASH_DEDICATED=ON -DCMAKE_C_FLAGS="-m32" -DCMAKE_CXX_FLAGS="-m32" ../ \ - && make \ - && make install \ - && mv engine/xash3d /usr/local/bin/xashds \ - && rm -rf /xash3d - USER steam WORKDIR /opt/steam SHELL ["/bin/bash", "-o", "pipefail", "-c"] -COPY ./lib/hlds.install /opt/steam -RUN curl -sL "$steamcmd_url" | tar xzvf - \ - && ./steamcmd.sh +runscript hlds.install +RUN mkdir -p /opt/steam/xashds RUN curl -sLJO "$hlds_url" \ && unzip "hlds_build_$hlds_build.zip" -d "/opt/steam/hlds_build_$hlds_build" \ && cp -R "hlds_build_$hlds_build/hlds"/* xashds/ \ && rm -rf "hlds_build_$hlds_build" "hlds_build_$hlds_build.zip" -# Fix error that steamclient.so is missing -RUN mkdir -p "$HOME/.steam" \ - && ln -s /opt/steam/linux32 "$HOME/.steam/sdk32" +RUN git clone --recursive https://github.com/FWGS/xash3d-fwgs \ + && cd xash3d-fwgs \ + && ARCH=i386 ./waf configure -T release -d --enable-lto \ + && ./waf build \ + && ./waf install --destdir /opt/steam/xashds \ + && cd .. && rm -rf xash3d-fwgs # Fix warnings: # couldn't exec listip.cfg @@ -95,8 +70,7 @@ RUN curl -sqL "$jk_botti_url" | tar -C /opt/steam/xashds/valve/ -xJ \ && echo 'linux addons/jk_botti/dlls/jk_botti_mm_i386.so' >> /opt/steam/xashds/valve/addons/metamod/plugins.ini WORKDIR /opt/steam/xashds - -RUN mv cstrike/liblist.gam cstrike/gameinfo.txt +RUN rm -rf ./cstrike RUN mv valve/liblist.gam valve/gameinfo.txt # Copy default config @@ -106,7 +80,7 @@ EXPOSE 27015 EXPOSE 27015/udp # Start server -ENTRYPOINT ["xashds"] +ENTRYPOINT ["./xash"] # Default start parameters -CMD ["+ip 0.0.0.0", "-timeout 3", "-pingboost 1", "+rcon_password 12345678"] +CMD ["+ip 0.0.0.0", "+rcon_password 12345678"] diff --git a/lib/hlds.install b/lib/hlds.install deleted file mode 100644 index 5a7e01e..0000000 --- a/lib/hlds.install +++ /dev/null @@ -1,8 +0,0 @@ -login anonymous -force_install_dir ./xashds -app_set_config 90 mod valve -app_update 90 -app_update 90 -app_update 90 validate -app_update 90 validate -quit