Initial verison

Dockerfile to build
Makefile to help
Add some files to fix HLDS issues + SHA sums
This commit is contained in:
Ari Timonen 2018-04-18 20:14:52 +00:00
parent 77b4158bc3
commit 45fb006215
7 changed files with 169 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
cfg/*.cfg

48
Dockerfile Normal file
View file

@ -0,0 +1,48 @@
FROM ubuntu
RUN dpkg --add-architecture i386 && \
apt-get update && \
apt-get -y install wget lib32gcc1 lib32stdc++6 libcurl3 unzip
RUN printf "\n2\n"|apt-get install -y steamcmd
RUN useradd -m steam
USER steam
WORKDIR /home/steam
RUN mkdir -p /home/steam/hlds/steamapps/
# Run app validate several times workaround HLDS bug
RUN /usr/games/steamcmd +login anonymous +force_install_dir /home/steam/hlds +app_set_config 90 mod valve +app_update 90 validate +app_update 90 +quit
# HLDS bug workaround. Whee.
COPY --chown=steam files/*.acf /home/steam/hlds/steamapps/
# HLDS bug workaround. Geez.
RUN printf "quit\nquit\n"|/usr/games/steamcmd +login anonymous +force_install_dir /home/steam/hlds +app_set_config 90 mod valve +app_update 90 validate || echo
RUN printf "quit\nquit\n"|/usr/games/steamcmd +login anonymous +force_install_dir /home/steam/hlds +app_set_config 90 mod valve +app_update 90 validate || echo
RUN printf "quit\nquit\nquit\nquit\nquit\n" |/usr/games/steamcmd +login anonymous +force_install_dir /home/steam/hlds +app_set_config 90 mod valve +app_update 90 validate || echo
# HLDS bug workaround. Yay.
RUN mkdir -p ~/.steam/sdk32 && ln -s ~/.steam/steamcmd/linux32/steamclient.so ~/.steam/sdk32/steamclient.so
WORKDIR /home/steam/hlds
RUN wget 'https://www.ensl.org/files/server/ns_dedicated_server_v32.zip'
COPY --chown=steam files/ns.sha /home/steam/hlds
# RUN sha256sum -c ns.sha
RUN unzip ns_dedicated_server_v32.zip
# NS workaround
RUN echo 70 > ns/steam_appid.txt
RUN mv ns/dlls/ns_i386.so ns/dlls/ns.so
# VAC, HLDS, RCON, HLTV
EXPOSE 26900
EXPOSE 27015/udp
EXPOSE 27015
EXPOSE 27020
ENTRYPOINT ["./hlds_run", "-game ns", "+maxplayers 32", "+log on"]

38
Makefile Normal file
View file

@ -0,0 +1,38 @@
REGISTRY ?= ensl
PROJECT ?= ensl_hlds
TAG ?= latest
.PHONY: all clean build
ifdef REGISTRY
IMAGE=$(REGISTRY)/$(PROJECT):$(TAG)
else
IMAGE=$(PROJECT):$(TAG)
endif
all:
@echo "Available targets:"
@echo " * build - build a Docker image for $(IMAGE)"
@echo " * pull - pull $(IMAGE)"
@echo " * push - push $(IMAGE)"
@echo " * test - build and test $(IMAGE)"
build: Dockerfile
docker build -t $(IMAGE) .
run: build
docker run -ti $(IMAGE)
shell: build
docker run -u0 -ti $(IMAGE) -v $(shell pwd)/logs:/home/steam/hlds/ns/logs /bin/bash
pull:
docker pull $(IMAGE) || true
push:
docker push $(IMAGE)
clean:
rm -f $(shell pwd)/logs/*
docker ps -a | awk '{ print $$1,$$2 }' | grep $(IMAGE) |awk '{print $$1 }' |xargs -I {} docker rm {}
docker images -a |grep $(IMAGE) |awk '{print $$3}' |xargs -I {} docker rmi {}

24
files/appmanifest_10.acf Normal file
View file

@ -0,0 +1,24 @@
"AppState"
{
"appid" "10"
"Universe" "1"
"name" "Counter-Strike"
"StateFlags" "68"
"installdir" "Half-Life"
"LastUpdated" "1488680852"
"UpdateResult" "0"
"SizeOnDisk" "292827978"
"buildid" "68736"
"LastOwner" "0"
"BytesToDownload" "0"
"BytesDownloaded" "0"
"AutoUpdateBehavior" "0"
"AllowOtherDownloadsWhileRunning" "0"
"UserConfig"
{
}
"MountedDepots"
{
"11" "3149618157612033597"
}
}

25
files/appmanifest_70.acf Normal file
View file

@ -0,0 +1,25 @@
"AppState"
{
"appid" "70"
"Universe" "1"
"name" "Half-Life"
"StateFlags" "68"
"installdir" "Half-Life"
"LastUpdated" "1488680861"
"UpdateResult" "0"
"SizeOnDisk" "445330938"
"buildid" "392283"
"LastOwner" "0"
"BytesToDownload" "0"
"BytesDownloaded" "0"
"AutoUpdateBehavior" "0"
"AllowOtherDownloadsWhileRunning" "0"
"UserConfig"
{
}
"MountedDepots"
{
"1" "5409401804038872403"
"71" "778444776426820105"
}
}

32
files/appmanifest_90.acf Normal file
View file

@ -0,0 +1,32 @@
"AppState"
{
"appid" "90"
"Universe" "1"
"name" "Half-Life Dedicated Server"
"StateFlags" "4"
"installdir" "Half-Life"
"LastUpdated" "1488680861"
"UpdateResult" "0"
"SizeOnDisk" "65004938"
"buildid" "332582"
"LastOwner" "76561200110338092"
"BytesToDownload" "0"
"BytesDownloaded" "0"
"AutoUpdateBehavior" "0"
"AllowOtherDownloadsWhileRunning" "0"
"UserConfig"
{
"mod" ""
}
"MountedDepots"
{
"4" "6246909582980773196"
"1006" "4715250324459675628"
}
"SharedDepots"
{
"1" "70"
"11" "10"
"71" "70"
}
}

1
files/ns.sha Normal file
View file

@ -0,0 +1 @@
e1f58f3c671b4c4a6735f4a36cb65da88e6bfc5337a3cb837bfa400d73733896 ns_dedicated_server_v32.zip