From 7d3e6a889212a279d904a86dd94b0cd5bae80188 Mon Sep 17 00:00:00 2001 From: Daniel Wolf Date: Fri, 28 Feb 2020 22:46:54 -0500 Subject: [PATCH] initial commit --- .dockerignore | 5 +++++ .drone.yml | 36 +++++++++++++++++++++++++++++++++ .gitignore | 2 ++ Dockerfile | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++ LICENSE.md | 13 ++++++++++++ README.md | 50 +++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 162 insertions(+) create mode 100644 .dockerignore create mode 100644 .drone.yml create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100644 LICENSE.md create mode 100644 README.md diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..348e0d4 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +.drone.yml +.git +.gitignore +LICENSE.md +README.md diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..013446a --- /dev/null +++ b/.drone.yml @@ -0,0 +1,36 @@ +--- +kind: pipeline +type: exec +name: default + +platform: + os: linux + arch: amd64 + +steps: +- name: build-latest + commands: + - docker build --pull -t pdr.nephatrine.net/nephatrine/quake2-server:latest . + - HOME=/mnt/config/home docker push pdr.nephatrine.net/nephatrine/quake2-server:latest + - docker tag pdr.nephatrine.net/nephatrine/quake2-server:latest nephatrine/quake2-server:latest + - HOME=/mnt/config/home docker push nephatrine/quake2-server:latest + - docker rmi pdr.nephatrine.net/nephatrine/quake2-server:latest + +--- +kind: pipeline +name: after + +steps: +- name: notify + image: appleboy/drone-discord + settings: + avatar_url: https://files.nephatrine.net/Images/Buttons/Drone.png + message: "Automated build of **{{repo.name}}:{{commit.branch}}** has returned [{{build.status}}]({{build.link}})." + username: DroneCI + webhook_id: + from_secret: webhook-id + webhook_token: + from_secret: webhook-token + +depends_on: +- default \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f8fa68e --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +fix-perms.sh +test-build.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0973cca --- /dev/null +++ b/Dockerfile @@ -0,0 +1,56 @@ +FROM ubuntu:rolling +LABEL maintainer="Daniel Wolf " + +ENV DEBIAN_FRONTEND=noninteractive +RUN echo "====== INSTALL PACKAGES ======" \ + && apt-get update -q \ + && apt-get -y -qq install apt-utils \ + && apt-get -y -q -o Dpkg::Options::="--force-confnew" install \ + quake2-server yamagi-quake2-core \ + wget \ + && apt-get clean \ + && rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/* + +RUN echo "====== BUILD MODULES ======" \ + && rm -rf /usr/share/games/quake2/baseq2/* \ + && apt-get update -q \ + && apt-get -y -q -o Dpkg::Options::="--force-confnew" install cmake g++ git make \ + && cd /usr/src \ + && git clone https://github.com/yquake2/ctf.git && cd ctf \ + && mkdir build && cd build \ + && cmake -DCMAKE_BUILD_TYPE=Release .. && make \ + && mkdir -p /usr/lib/yamagi-quake2/ctf && cp Release/game.so /usr/lib/yamagi-quake2/ctf/ \ + && mkdir /usr/share/games/quake2/ctf \ + && cd /usr/src \ + && git clone https://github.com/yquake2/3zb2.git && cd 3zb2 \ + && grep -v g_turret.c CMakeLists.txt > CMakeLists2.txt && mv CMakeLists2.txt CMakeLists.txt \ + && mkdir build && cd build \ + && cmake -DCMAKE_BUILD_TYPE=Release .. && make \ + && mkdir /usr/lib/yamagi-quake2/3zb2 && cp Release/game.so /usr/lib/yamagi-quake2/3zb2/ \ + && mkdir /usr/share/games/quake2/3zb2 \ + && cd /usr/src \ + && git clone https://github.com/yquake2/xatrix.git && cd xatrix \ + && mkdir build && cd build \ + && cmake -DCMAKE_BUILD_TYPE=Release .. && make \ + && mkdir /usr/lib/yamagi-quake2/xatrix && cp Release/game.so /usr/lib/yamagi-quake2/xatrix/ \ + && mkdir /usr/share/games/quake2/xatrix \ + && cd /usr/src \ + && git clone https://github.com/yquake2/rogue.git && cd rogue \ + && mkdir build && cd build \ + && cmake -DCMAKE_BUILD_TYPE=Release .. && make \ + && mkdir /usr/lib/yamagi-quake2/rogue && cp Release/game.so /usr/lib/yamagi-quake2/rogue/ \ + && mkdir /usr/share/games/quake2/rogue \ + && cd /usr/src \ + && git clone https://github.com/yquake2/zaero.git && cd zaero \ + && mkdir build && cd build \ + && cmake -DCMAKE_BUILD_TYPE=Release .. && make \ + && mkdir /usr/lib/yamagi-quake2/zaero && cp Release/game.so /usr/lib/yamagi-quake2/zaero/ \ + && mkdir /usr/share/games/quake2/zaero \ + && apt-get -y -q purge cmake g++ git make \ + && apt-get -y -q autoremove \ + && cd /usr/src && rm -rf /tmp/* /usr/src/* /var/lib/apt/lists/* /var/tmp/* + +USER quake2-server +EXPOSE 27910/udp +ENTRYPOINT ["/usr/share/games/quake2/quake2-server"] +CMD ["+exec", "server.cfg"] diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..707dde9 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,13 @@ +Copyright © 2019 Daniel Wolf <> + +**Permission to use, copy, modify, and distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies.** + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..057690f --- /dev/null +++ b/README.md @@ -0,0 +1,50 @@ +[Git](https://code.nephatrine.net/nephatrine/docker-quake2) | +[Docker](https://hub.docker.com/r/nephatrine/quake2-server/) | +[unRAID](https://code.nephatrine.net/nephatrine/unraid-containers) + +[![Build Status](https://ci.nephatrine.net/api/badges/nephatrine/docker-quake2/status.svg?ref=refs/heads/master)](https://ci.nephatrine.net/nephatrine/docker-quake2) + +# Docker Registry + +This docker image contains a Docker Registry server to self-host your own +docker registry. + +**YOU WILL NEED TO USE A SEPARATE REVERSE PROXY SERVER TO SECURE THIS SERVICE. +SEE THE [DOCUMENTATION](https://docs.docker.com/registry/recipes/nginx/) FOR +MORE DETAILS ON HOW TO CONFIGURE SUCH A PROXY.** + +- [Docker Registry](https://docs.docker.com/registry/) + +You can spin up a quick temporary test container like this: + +~~~ +docker run --rm -p 27910:27910 -it nephatrine/quake2-server:latest /bin/bash +~~~ + +## Persistent Mounts + +You can provide a persistent mountpoint using the ``-v /host/path:/container/path`` +syntax. These mountpoints are intended to house important configuration files, +logs, and application state (e.g. databases) so they are not lost on image +update. + +- ``/usr/share/games/quake2/baseq2``: Quake II Game Data. +- ``/usr/share/games/quake2/ctf``: CTF Game Data. +- ``/usr/share/games/quake2/xatrix``: The Reckoning Game Data. +- ``/usr/share/games/quake2/rogue``: Ground Zero Game Data. +- ``/usr/share/games/quake2/zaero``: Zaero Game Data. +- ``/usr/share/games/quake2/3zb2``: 3rd Zigock Bot Game Data. + +There is no game data included in the image - not even the shareware demo. +Please populate this yourself with a legal copy of Quake II. + +On startup, the game will execute the ``server.cfg`` found in the ``baseq2`` +folder and so you can configure settings there. + +## Network Services + +This container runs network services that are intended to be exposed outside +the container. You can map these to host ports using the ``-p HOST:CONTAINER`` +or ``-p HOST:CONTAINER/PROTOCOL`` syntax. + +- ``27910/tcp``: Quake II Server. This is the game server.