Added base ReHLDS server
This commit is contained in:
100
Dockerfile
100
Dockerfile
@ -1,49 +1,63 @@
|
||||
FROM ubuntu:20.04
|
||||
FROM ubuntu:22.04
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
RUN echo "=== Updating Ubuntu ===" && \
|
||||
dpkg --add-architecture i386 && \
|
||||
apt-get update && \
|
||||
apt-get install -y software-properties-common && \
|
||||
add-apt-repository ppa:ubuntu-toolchain-r/test && \
|
||||
apt-get update && \
|
||||
apt-get install -y \
|
||||
build-essential \
|
||||
gcc-11 \
|
||||
g++-11 \
|
||||
g++-11-multilib \
|
||||
libc6-dev:i386 \
|
||||
libc6:i386 \
|
||||
libstdc++6:i386 \
|
||||
lib32stdc++6 \
|
||||
zlib1g:i386 \
|
||||
wget \
|
||||
cmake \
|
||||
git \
|
||||
ca-certificates && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN apt update && apt install -y \
|
||||
curl \
|
||||
ca-certificates \
|
||||
lib32gcc-s1 \
|
||||
lib32stdc++6 \
|
||||
unzip \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
# Устанавливаем SteamCMD и загружаем через него оригинальный HLDS + CS 1.6:
|
||||
RUN echo "=== Installing SteamCMD & HLDS ===" && \
|
||||
mkdir -p /opt/hlds /opt/steamcmd && cd /opt/steamcmd && \
|
||||
wget http://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz && \
|
||||
tar xvfz steamcmd_linux.tar.gz && \
|
||||
./steamcmd.sh \
|
||||
+@sSteamCmdForcePlatformType linux \
|
||||
+force_install_dir /opt/hlds \
|
||||
+login anonymous \
|
||||
+app_set_config 90 mod cstrike \
|
||||
+app_update 90 -beta steam_legacy validate \
|
||||
+quit
|
||||
|
||||
# Создаем нужные директории
|
||||
RUN mkdir -p /steamcmd /hlds
|
||||
# Устанавливаем ReHLDS и помещаем с заменой в HLDS
|
||||
RUN echo "=== Installing ReHLDS ===" && \
|
||||
cd /opt/ && \
|
||||
git clone https://github.com/rehlds/ReHLDS.git && \
|
||||
cd ReHLDS && \
|
||||
chmod +x build.sh && \
|
||||
./build.sh --compiler=gcc --jobs=$(nproc) -DDEBUG=OFF && \
|
||||
mv ./build/rehlds/HLTV/Console/hltv /opt/hlds/hltv && \
|
||||
mv ./build/rehlds/HLTV/Core/core.so /opt/hlds/core.so && \
|
||||
mv ./build/rehlds/HLTV/DemoPlayer/demoplayer.so /opt/hlds/demoplayer.so && \
|
||||
mv ./build/rehlds/HLTV/Director/director.so /opt/hlds/valve/dlls/director.so && \
|
||||
mv ./build/rehlds/HLTV/Proxy/proxy.so /opt/hlds/proxy.so && \
|
||||
mv ./build/rehlds/engine_i486.so /opt/hlds/engine_i486.so && \
|
||||
mv ./build/rehlds/dedicated/hlds_linux /opt/hlds/hlds_linux && \
|
||||
mv ./build/rehlds/filesystem/FileSystem_Stdio/filesystem_stdio.so /opt/hlds/filesystem_stdio.so && \
|
||||
cd /opt/ && \
|
||||
rm -rf ReHLDS && \
|
||||
rm /opt/hlds/libstdc++.so.6 && \
|
||||
rm /opt/hlds/libgcc_s.so.1
|
||||
|
||||
WORKDIR /steamcmd
|
||||
|
||||
# Скачиваем и распаковываем steamcmd
|
||||
RUN curl -sSL https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz | tar -xz
|
||||
|
||||
# Скачиваем HLDS с нужной beta-версией
|
||||
RUN ./steamcmd.sh +@sSteamCmdForcePlatformType linux \
|
||||
+login anonymous \
|
||||
+force_install_dir /hlds \
|
||||
+app_set_config 90 mod cstrike \
|
||||
+app_update 90 -beta steam_legacy validate \
|
||||
+quit
|
||||
|
||||
# Удаляем ненужные steam-библиотеки, если вдруг попали
|
||||
RUN rm -f /hlds/steamclient.so /hlds/libsteam_api.so /hlds/steam_api.so
|
||||
|
||||
# Копируем файлы ReHLDS (должен быть ./rehlds/bin/linux32/ внутри контекста билда)
|
||||
COPY rehlds/ /hlds/
|
||||
|
||||
# Делаем основной бинарник исполняемым
|
||||
RUN chmod +x /hlds/hlds_linux
|
||||
|
||||
# Копируем start.sh (обязателен для запуска)
|
||||
COPY start.sh /start.sh
|
||||
RUN chmod +x /start.sh
|
||||
|
||||
# Указываем точку входа
|
||||
ENTRYPOINT ["/start.sh"]
|
||||
|
||||
# Открываем нужные порты
|
||||
# Открываем порт и задаём команду запуска сервера
|
||||
EXPOSE 27015/udp
|
||||
EXPOSE 27020/udp
|
||||
WORKDIR /opt/hlds
|
||||
CMD ["/opt/hlds/hlds_run", "-console", "-game", "cstrike", "+map", "de_dust2"]
|
||||
|
||||
SHELL ["/bin/bash", "-c"]
|
||||
#CMD ["sleep", "infinity"]
|
||||
|
Reference in New Issue
Block a user