Can now override the entire directory tree if necessary, can override start-server for custom start up

This commit is contained in:
sairuk 2019-02-16 13:01:39 +11:00
parent 28c3fb527a
commit b1b04e4af4
24 changed files with 20 additions and 17 deletions

5
.gitignore vendored Normal file
View file

@ -0,0 +1,5 @@
build_image
run_container
*.cs
*.dso
_custom/start-server.sh

View file

@ -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"]

View file

@ -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

View file

@ -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