Containerized version of SRB2Kart. This is a fork of rwanyoikes Dockerfile
Containerized version of SRB2Kart, a kart racing mod based on the 3D Sonic the Hedgehog fangame Sonic Robo Blast 2, based on a modified version of Doom Legacy. You can use SRB2Kart to run a SRB2Kart dedicated netgame server given the proper config.
This will pull an image with SRB2Kart and start a dedicated netgame server on port 5029/udp
:
docker run -it --name srb2kart -p 5029:5029/udp jetcodesstuff/srb2-kartserv:latest
The ~/.srb2kart
directory is symlinked to /kart
in the container. You can bind-mount a SRB2Kart directory (with configuration files, mods, etc.) on the host machine to the /kart
directory inside the container. For example:
In order to load addons, bind the /addons
volume to a host directory and copy them there.
docker run -it --name srb2kart -p 5029:5029/udp -v /path/on/host/addons:/addons ellite/srb2kart-server:latest
$ tree srb2kart-myserver/
srb2kart-myserver
βββ mods
βΒ Β βββ kl_xxx.pk3
βΒ Β βββ kl_xxx.wad
βΒ Β βββ kr_xxx.pk3
βββ kartserv.cfg
1 directory, 4 files
This directory must be accessible to the user account that is used to run SRB2Kart inside the container. If your host machine is run under *nix OS, SRB2Kart uses the non-root account
1000:1000
(group:id
, respectively).
docker run --rm -it --name srb2kart \
-v <path to data directory>:/kart \
-p <port on host>:5029/udp \
jetcodesstuff/srb2-kartserv:<version> -dedicated -file \
mods/kl_xxx.pk3 \
mods/kl_xxx.wad \
mods/kr_xxx.pk3
Here's an example of how to run the container as a service on Linux with the help of systemd
.
- Create a systemd service descriptor file:
# /etc/systemd/system/docker.srb2kart.service
[Unit]
Description=SRB2Kart Server
Requires=docker.service
After=docker.service
# Ref: https://www.freedesktop.org/software/systemd/man/systemd.unit.html#StartLimitIntervalSec=interval
StartLimitIntervalSec=60s
StartLimitBurst=2
[Service]
TimeoutStartSec=0
Restart=on-failure
RestartSec=5s
ExecStartPre=/usr/bin/docker stop %n
ExecStartPre=/usr/bin/docker rm %n
ExecStartPre=/usr/bin/docker pull jetcodesstuff/srb2-kartserv:<version>
ExecStart=/usr/bin/docker run --rm --name %n \
-v <path to data directory>:/kart \
-p <port on host>:5029/udp \
jetcodesstuff/srb2-kartserv:<version>
[Install]
WantedBy=multi-user.target
- Enable starting the service on system boot:
systemctl enable docker.srb2kart
git clone https://github.com/ellite/srb2kart-server-docker
cd srb2kart-server-docker/
# Ref for version numbers: https://github.com/STJr/Kart-Public/releases
docker build --build-arg "SRB2KART_VERSION=<version>" \
-t srb2kart-server:<version> .
The build will download the Source Code and build the SRB2Kart executable, as well as download the data files (/usr/share/games/SRB2Kart
) for SRB2Kart.
This project is licensed under the GPLv2 License.