commit
0f8d559b17
11 changed files with 179 additions and 0 deletions
@ -0,0 +1,39 @@ |
|||||||
|
FROM debian:stable-slim |
||||||
|
|
||||||
|
RUN apt-get update -y && apt-get install -y wget bzip2 libsdl1.2debian unzip |
||||||
|
|
||||||
|
WORKDIR /src |
||||||
|
|
||||||
|
# Download and extract soruce |
||||||
|
RUN wget https://zandronum.com/downloads/zandronum3.0-linux-x86_64.tar.bz2 |
||||||
|
RUN tar xjf zandronum*.tar.bz2 |
||||||
|
|
||||||
|
# Extract libs used by server |
||||||
|
RUN mkdir -p /export/libs |
||||||
|
COPY extract_server.sh . |
||||||
|
RUN bash ./extract_server.sh zandronum-server /export/libs |
||||||
|
RUN cp libcrypto* /export/libs |
||||||
|
|
||||||
|
# Copy server and required files to /export |
||||||
|
RUN cp zandronum-server zandronum.pk3 /export/ |
||||||
|
|
||||||
|
# Download FreeDM WAD |
||||||
|
RUN wget https://github.com/freedoom/freedoom/releases/download/v0.12.1/freedm-0.12.1.zip |
||||||
|
RUN unzip freed*.zip |
||||||
|
RUN cd freedm* && cp freedm.wad /export |
||||||
|
|
||||||
|
# Libraries that aren't in busybox or alpines musl are needed :( |
||||||
|
FROM debian:stable-slim |
||||||
|
|
||||||
|
EXPOSE 10666/udp |
||||||
|
|
||||||
|
RUN mkdir -p /srv |
||||||
|
COPY --from=0 /export /srv |
||||||
|
COPY server.cfg /srv |
||||||
|
COPY entrypoint.sh /srv |
||||||
|
|
||||||
|
RUN useradd -m zandronum |
||||||
|
RUN chown -R zandronum /srv |
||||||
|
USER zandronum |
||||||
|
|
||||||
|
ENTRYPOINT /srv/entrypoint.sh |
@ -0,0 +1,3 @@ |
|||||||
|
# Docker Doom Server |
||||||
|
|
||||||
|
See WIP/ for other nearly finished attempts of other servers |
@ -0,0 +1,18 @@ |
|||||||
|
FROM debian:stable-slim |
||||||
|
|
||||||
|
RUN apt-get update -y && apt-get install -y chocolate-doom |
||||||
|
|
||||||
|
RUN apt-get clean autoclean && apt-get autoremove --yes && rm -rf /var/lib/{apt,dpkg,cache,log}/ |
||||||
|
|
||||||
|
RUN mkdir -p /export/libs |
||||||
|
|
||||||
|
COPY extract_server.sh / |
||||||
|
RUN bash /extract_server.sh /usr/games/chocolate-server /export/libs |
||||||
|
|
||||||
|
FROM debian:stable-slim |
||||||
|
|
||||||
|
COPY --from=0 /export /srv |
||||||
|
|
||||||
|
EXPOSE 10666/udp |
||||||
|
|
||||||
|
CMD LD_LIBRARY_PATH=/srv/libs /srv/chocolate-server -privateserver -port 10666 |
@ -0,0 +1,7 @@ |
|||||||
|
# Chocolate Doom |
||||||
|
|
||||||
|
Chocolate Doom is neat for it's retro appeal, but it doesn't really work |
||||||
|
outside of a LAN party imo. I eventually went with Zandronum due to it's Linux |
||||||
|
support and modern online play capabilities. |
||||||
|
|
||||||
|
If you want to build this make sure you copy in extract_server.sh from above. |
@ -0,0 +1,39 @@ |
|||||||
|
# Switch to alpine to serve content built above |
||||||
|
FROM ubuntu:latest |
||||||
|
|
||||||
|
RUN apt-get update -y |
||||||
|
RUN apt-get install -y cmake wget g++ unzip |
||||||
|
|
||||||
|
RUN mkdir /src |
||||||
|
|
||||||
|
WORKDIR /src |
||||||
|
|
||||||
|
RUN wget https://github.com/odamex/odamex/archive/0.8.1.tar.gz |
||||||
|
RUN tar xvzf *.tar.gz |
||||||
|
|
||||||
|
COPY build_odamex.sh /build_odamex.sh |
||||||
|
RUN /build_odamex.sh |
||||||
|
|
||||||
|
RUN wget https://github.com/freedoom/freedoom/releases/download/v0.12.1/freedm-0.12.1.zip |
||||||
|
RUN unzip freedm*.zip |
||||||
|
RUN cp freedm*/freedm.wad /export |
||||||
|
|
||||||
|
# Using debian slim as opposed to alpine because |
||||||
|
# odamex uses libraries only available in glibc |
||||||
|
FROM debian:stable-slim |
||||||
|
|
||||||
|
COPY --from=0 /export/odasrv /srv/odasrv |
||||||
|
COPY --from=0 /export/odamex.wad /srv/odamex.wad |
||||||
|
COPY --from=0 /export/freedm.wad /srv/freedm.wad |
||||||
|
COPY odasrv.cfg /srv/odasrv.cfg |
||||||
|
|
||||||
|
# RUN useradd --no-create-home --shell /bin/false odamex |
||||||
|
RUN useradd -m --shell /bin/false odamex |
||||||
|
|
||||||
|
RUN chown -R odamex:odamex /srv/ |
||||||
|
|
||||||
|
USER odamex |
||||||
|
|
||||||
|
CMD /srv/odasrv -config /srv/odasrv.cfg |
||||||
|
|
||||||
|
EXPOSE 10666/udp |
@ -0,0 +1,6 @@ |
|||||||
|
# Docker Odamex |
||||||
|
|
||||||
|
You can use this to build a Odamex Doom server. |
||||||
|
|
||||||
|
I put a lot of work into this, but ultimately went with Zandronum due to it's |
||||||
|
compatibility with Linux. I couldn't get audio working with Odamex :( |
@ -0,0 +1,16 @@ |
|||||||
|
#!/bin/sh |
||||||
|
|
||||||
|
set -e |
||||||
|
|
||||||
|
cd /src/odamex* |
||||||
|
|
||||||
|
mkdir /export |
||||||
|
|
||||||
|
cp odamex.wad /export |
||||||
|
|
||||||
|
mkdir build |
||||||
|
cd build && cmake .. -DCMAKE_BUILD_TYPE=MinSizRel -DBUILD_CLIENT=0 -DBUILD_ODALAUNCH=0 |
||||||
|
|
||||||
|
make odasrv |
||||||
|
|
||||||
|
cp server/odasrv /export |
@ -0,0 +1,2 @@ |
|||||||
|
sv_usemasters 0 |
||||||
|
|
@ -0,0 +1,27 @@ |
|||||||
|
#!/bin/bash |
||||||
|
|
||||||
|
set -e |
||||||
|
|
||||||
|
BOT_COUNT=${BOT_COUNT:-0} |
||||||
|
|
||||||
|
if [ -n "$SV_HOSTNAME" ]; then |
||||||
|
echo "set sv_hostname $SV_HOSTNAME" >> /srv/server.cfg |
||||||
|
fi |
||||||
|
|
||||||
|
if [ -n "$RCON_PASSWORD" ]; then |
||||||
|
echo "set sv_rconpassword $RCON_PASSWORD" >> /srv/server.cfg |
||||||
|
fi |
||||||
|
|
||||||
|
# As of Zandrodum 3.0.0 we have to use `+addbot` instead using server.cfg |
||||||
|
# https://zandronum.com/forum/viewtopic.php?t=8073<Paste> |
||||||
|
ADDBOT_CMDS="" |
||||||
|
for _ in $(seq $BOT_COUNT); do |
||||||
|
ADDBOT_CMDS+='+addbot "" ' |
||||||
|
done |
||||||
|
|
||||||
|
PORT=${PORT:-10666} |
||||||
|
|
||||||
|
GAMETYPE=${GAMETYPE:-Deathmatch} |
||||||
|
|
||||||
|
SV_ARGS="+exec server.cfg -port $PORT $ADDBOT_CMDS +$GAMETYPE true" |
||||||
|
cd /srv/ && LD_LIBRARY_PATH=libs sh -c "./zandronum-server $SV_ARGS" |
@ -0,0 +1,12 @@ |
|||||||
|
# Many thanks to https://www.h3manth.com/content/copying-shared-library-dependencies |
||||||
|
|
||||||
|
set -e |
||||||
|
|
||||||
|
cp $1 /export |
||||||
|
|
||||||
|
deps=$(ldd $1 | awk 'BEGIN{ORS=" "}$1~/^\//{print $1}$3~/^\//{print $3}' | sed 's/,$/\n/') |
||||||
|
|
||||||
|
for dep in $deps; do |
||||||
|
echo "Copying $dep to $2" |
||||||
|
cp "$dep" "$2" |
||||||
|
done |
@ -0,0 +1,10 @@ |
|||||||
|
// https://wiki.zandronum.com/Server_Variables |
||||||
|
|
||||||
|
// Disable mouselook |
||||||
|
set sv_nofreelook true |
||||||
|
|
||||||
|
// Timestamp console messages |
||||||
|
set sv_timestamp true |
||||||
|
|
||||||
|
// Prepend CHAT to all chat messages in the log |
||||||
|
set sv_markchatlines true |
Loading…
Reference in new issue