From b1b04e4af48dd7b51871597d9f5d4d74b21e27b1 Mon Sep 17 00:00:00 2001 From: sairuk Date: Sat, 16 Feb 2019 13:01:39 +1100 Subject: [PATCH] Can now override the entire directory tree if necessary, can override start-server for custom start up --- .gitignore | 5 +++++ Dockerfile | 14 +++++++------- README.md | 16 +++++++--------- _custom/{ => GameData}/Classic/prefs/dummy | 0 .../Classic/scripts/autoexec/dummy | 0 _custom/{ => GameData}/Construction/prefs/dummy | 0 .../Construction/scripts/autoexec/dummy | 0 _custom/{ => GameData}/FuryTV/prefs/dummy | 0 .../{ => GameData}/FuryTV/scripts/autoexec/dummy | 0 _custom/{ => GameData}/Meltdown2/prefs/dummy | 0 .../Meltdown2/scripts/autoexec/dummy | 0 _custom/{ => GameData}/Mousemod/prefs/dummy | 0 .../Mousemod/scripts/autoexec/dummy | 0 _custom/{ => GameData}/Shifter/prefs/dummy | 0 .../Shifter/scripts/autoexec/dummy | 0 _custom/{ => GameData}/Triumph/prefs/dummy | 0 .../Triumph/scripts/autoexec/dummy | 0 _custom/{ => GameData}/base/prefs/dummy | 0 .../{ => GameData}/base/scripts/autoexec/dummy | 0 _custom/{ => GameData}/tac/prefs/dummy | 0 .../{ => GameData}/tac/scripts/autoexec/dummy | 0 _custom/{ => GameData}/variant/prefs/dummy | 0 .../variant/scripts/autoexec/dummy | 0 _scripts/start-server | 2 +- 24 files changed, 20 insertions(+), 17 deletions(-) create mode 100644 .gitignore rename _custom/{ => GameData}/Classic/prefs/dummy (100%) rename _custom/{ => GameData}/Classic/scripts/autoexec/dummy (100%) rename _custom/{ => GameData}/Construction/prefs/dummy (100%) rename _custom/{ => GameData}/Construction/scripts/autoexec/dummy (100%) rename _custom/{ => GameData}/FuryTV/prefs/dummy (100%) rename _custom/{ => GameData}/FuryTV/scripts/autoexec/dummy (100%) rename _custom/{ => GameData}/Meltdown2/prefs/dummy (100%) rename _custom/{ => GameData}/Meltdown2/scripts/autoexec/dummy (100%) rename _custom/{ => GameData}/Mousemod/prefs/dummy (100%) rename _custom/{ => GameData}/Mousemod/scripts/autoexec/dummy (100%) rename _custom/{ => GameData}/Shifter/prefs/dummy (100%) rename _custom/{ => GameData}/Shifter/scripts/autoexec/dummy (100%) rename _custom/{ => GameData}/Triumph/prefs/dummy (100%) rename _custom/{ => GameData}/Triumph/scripts/autoexec/dummy (100%) rename _custom/{ => GameData}/base/prefs/dummy (100%) rename _custom/{ => GameData}/base/scripts/autoexec/dummy (100%) rename _custom/{ => GameData}/tac/prefs/dummy (100%) rename _custom/{ => GameData}/tac/scripts/autoexec/dummy (100%) rename _custom/{ => GameData}/variant/prefs/dummy (100%) rename _custom/{ => GameData}/variant/scripts/autoexec/dummy (100%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ca2e8a5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +build_image +run_container +*.cs +*.dso +_custom/start-server.sh diff --git a/Dockerfile b/Dockerfile index ea7a361..aa54598 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,7 @@ MAINTAINER sairuk ARG SRVUSER=gameserv ARG SRVUID=1000 ARG SRVDIR=/tmp/tribes2/ +ENV INSTDIR=/home/${SRVUSER}/.wine/drive_c/Dynamix/Tribes2/ # UPDATE IMAGE RUN apt-get -y update && apt-get -y upgrade @@ -46,14 +47,13 @@ RUN chmod +x ${SRVDIR}/tribesnext-server-installer RUN ${SRVDIR}/tribesnext-server-installer -# SCRIPT - server -COPY _scripts/start-server /home/${SRVUSER}/start-server -RUN chmod +x /home/${SRVUSER}/start-server +# SCRIPT - server (default) +COPY _scripts/start-server ${INSTDIR}/start-server +RUN chmod +x ${INSTDIR}/start-server -# SCRIPT - custom -COPY _custom/Classic/. /home/${SRVUSER}/.wine/drive_c/Dynamix/Tribes2/GameData/Classic/ -COPY _custom/base/. /home/${SRVUSER}/.wine/drive_c/Dynamix/Tribes2/GameData/base/ +# SCRIPT - custom (custom content / overrides) +COPY _custom/. ${INSTDIR} # PERMISSIONS @@ -67,7 +67,7 @@ EXPOSE \ 28000/udp USER ${SRVUSER} -WORKDIR /home/${SRVUSER} +WORKDIR ${INSTDIR} CMD ["./start-server"] diff --git a/README.md b/README.md index 4210b4c..96bbb79 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ The server runs as the gameserv user ## Ports -Exposed ports are `666`, `28000`, the standard TribesNext ports, these can be mapped to whatever you need when you run the container, see the run_container script for an example of how to execute this. +Exposed ports are `666`, `28000`, the standard TribesNext ports, these can be mapped to whatever you need when you run the container, example below. ## Volumes @@ -27,7 +27,7 @@ No volumes are used **Run a container** -NB: the `--rm` arg will destroy the container when stopped. +NB: the `--rm` arg will destroy the container when stopped; internal ports (666) can be mapped to available host ports (27999) per container ``` docker run -d --rm \ -p 27999:666/tcp \ @@ -42,13 +42,8 @@ tribesnext-server:latest ## Server Customization -You can customize the server at build time by dropping the appropriate files at the appropriate locations in `_custom/`, these will be copied into the image in the appropriate places overwriting the default files if present. +You can customize the server at build time by dropping the appropriate files at the appropriate locations in `_custom/`, these will be copied into the image into the install location within the container at build time. -Currently supports -* base -* Classic - -If you want to add a new mod this will require a new `COPY` instruction added to the `Dockerfile` and an image rebuild, or raise an issue/pull request and we can look at updating the main repo. You can override the following defaults at build time ``` @@ -57,13 +52,16 @@ ARG SRVUID=1000 ARG SRVDIR=/tmp/tribes2/ ``` +You can also override the start-server script by added one to _custom this will overwrite the default at build time. + + ## Notes You can modify the installer script to update the source locations of the required files. `tribesnext-server-installer` may also be used in standalone mode to install TribesNext RC2a on the host system under wine but your mileage may vary. -Testing has been minimal +Testing has been minimal but it is running the NET247 server so you can try it out at any point. ## 2do * Thinner base OS diff --git a/_custom/Classic/prefs/dummy b/_custom/GameData/Classic/prefs/dummy similarity index 100% rename from _custom/Classic/prefs/dummy rename to _custom/GameData/Classic/prefs/dummy diff --git a/_custom/Classic/scripts/autoexec/dummy b/_custom/GameData/Classic/scripts/autoexec/dummy similarity index 100% rename from _custom/Classic/scripts/autoexec/dummy rename to _custom/GameData/Classic/scripts/autoexec/dummy diff --git a/_custom/Construction/prefs/dummy b/_custom/GameData/Construction/prefs/dummy similarity index 100% rename from _custom/Construction/prefs/dummy rename to _custom/GameData/Construction/prefs/dummy diff --git a/_custom/Construction/scripts/autoexec/dummy b/_custom/GameData/Construction/scripts/autoexec/dummy similarity index 100% rename from _custom/Construction/scripts/autoexec/dummy rename to _custom/GameData/Construction/scripts/autoexec/dummy diff --git a/_custom/FuryTV/prefs/dummy b/_custom/GameData/FuryTV/prefs/dummy similarity index 100% rename from _custom/FuryTV/prefs/dummy rename to _custom/GameData/FuryTV/prefs/dummy diff --git a/_custom/FuryTV/scripts/autoexec/dummy b/_custom/GameData/FuryTV/scripts/autoexec/dummy similarity index 100% rename from _custom/FuryTV/scripts/autoexec/dummy rename to _custom/GameData/FuryTV/scripts/autoexec/dummy diff --git a/_custom/Meltdown2/prefs/dummy b/_custom/GameData/Meltdown2/prefs/dummy similarity index 100% rename from _custom/Meltdown2/prefs/dummy rename to _custom/GameData/Meltdown2/prefs/dummy diff --git a/_custom/Meltdown2/scripts/autoexec/dummy b/_custom/GameData/Meltdown2/scripts/autoexec/dummy similarity index 100% rename from _custom/Meltdown2/scripts/autoexec/dummy rename to _custom/GameData/Meltdown2/scripts/autoexec/dummy diff --git a/_custom/Mousemod/prefs/dummy b/_custom/GameData/Mousemod/prefs/dummy similarity index 100% rename from _custom/Mousemod/prefs/dummy rename to _custom/GameData/Mousemod/prefs/dummy diff --git a/_custom/Mousemod/scripts/autoexec/dummy b/_custom/GameData/Mousemod/scripts/autoexec/dummy similarity index 100% rename from _custom/Mousemod/scripts/autoexec/dummy rename to _custom/GameData/Mousemod/scripts/autoexec/dummy diff --git a/_custom/Shifter/prefs/dummy b/_custom/GameData/Shifter/prefs/dummy similarity index 100% rename from _custom/Shifter/prefs/dummy rename to _custom/GameData/Shifter/prefs/dummy diff --git a/_custom/Shifter/scripts/autoexec/dummy b/_custom/GameData/Shifter/scripts/autoexec/dummy similarity index 100% rename from _custom/Shifter/scripts/autoexec/dummy rename to _custom/GameData/Shifter/scripts/autoexec/dummy diff --git a/_custom/Triumph/prefs/dummy b/_custom/GameData/Triumph/prefs/dummy similarity index 100% rename from _custom/Triumph/prefs/dummy rename to _custom/GameData/Triumph/prefs/dummy diff --git a/_custom/Triumph/scripts/autoexec/dummy b/_custom/GameData/Triumph/scripts/autoexec/dummy similarity index 100% rename from _custom/Triumph/scripts/autoexec/dummy rename to _custom/GameData/Triumph/scripts/autoexec/dummy diff --git a/_custom/base/prefs/dummy b/_custom/GameData/base/prefs/dummy similarity index 100% rename from _custom/base/prefs/dummy rename to _custom/GameData/base/prefs/dummy diff --git a/_custom/base/scripts/autoexec/dummy b/_custom/GameData/base/scripts/autoexec/dummy similarity index 100% rename from _custom/base/scripts/autoexec/dummy rename to _custom/GameData/base/scripts/autoexec/dummy diff --git a/_custom/tac/prefs/dummy b/_custom/GameData/tac/prefs/dummy similarity index 100% rename from _custom/tac/prefs/dummy rename to _custom/GameData/tac/prefs/dummy diff --git a/_custom/tac/scripts/autoexec/dummy b/_custom/GameData/tac/scripts/autoexec/dummy similarity index 100% rename from _custom/tac/scripts/autoexec/dummy rename to _custom/GameData/tac/scripts/autoexec/dummy diff --git a/_custom/variant/prefs/dummy b/_custom/GameData/variant/prefs/dummy similarity index 100% rename from _custom/variant/prefs/dummy rename to _custom/GameData/variant/prefs/dummy diff --git a/_custom/variant/scripts/autoexec/dummy b/_custom/GameData/variant/scripts/autoexec/dummy similarity index 100% rename from _custom/variant/scripts/autoexec/dummy rename to _custom/GameData/variant/scripts/autoexec/dummy diff --git a/_scripts/start-server b/_scripts/start-server index 22bd8fd..f4190af 100755 --- a/_scripts/start-server +++ b/_scripts/start-server @@ -8,5 +8,5 @@ find ${BASEDIR} -name \*.dso -execdir /bin/rm {} \; cd $WINEPREFIX/drive_c/Dynamix/Tribes2/GameData xvfb-run -a -w 5 \ -wine Tribes2.exe -dedicated -mod Classic +wine Tribes2.exe -dedicated