Skip to content

Commit

Permalink
actually making this a real build repo by utilizing jberrenbergs dock…
Browse files Browse the repository at this point in the history
…erfile and init file...just incase :)
  • Loading branch information
Loria, Mario committed Aug 27, 2015
1 parent 54751d7 commit c2f9e2e
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 5 deletions.
38 changes: 37 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,40 @@
FROM jberrenberg/quake3
FROM base/archlinux

# enable multilib and update base system
RUN \
pacman -Sy --noconfirm reflector && \
reflector --verbose -l 5 --sort rate --save /etc/pacman.d/mirrorlist && \
echo "[multilib]" >> /etc/pacman.conf && \
echo "Include = /etc/pacman.d/mirrorlist" >> /etc/pacman.conf && \
pacman -Syu --noconfirm && \
pacman-db-upgrade

# install dependencies
RUN pacman -S --noconfirm \
binutils \
fakeroot \
unzip \
lib32-libgl \
lib32-libxext

# install quake 3
RUN useradd -m q3a && \
curl -O https://aur.archlinux.org/packages/qu/quake3/quake3.tar.gz && \
tar xfz quake3.tar.gz -C /home/q3a/ && \
chown -R q3a /home/q3a/ && \
su q3a -c 'cd /home/q3a/quake3 && makepkg -f' && \
pacman --noconfirm -U /home/q3a/quake3/quake3-1.32c-2-x86_64.pkg.tar.xz && \
rm quake3.tar.gz

# bootstraping
COPY bootstrap.sh /usr/bin/
RUN chmod +x /usr/bin/bootstrap.sh

# environment variables
ENV FS_GAME='baseq3'

EXPOSE 27960/udp
ENTRYPOINT ["bootstrap.sh"]

## Lets copy in our own config
COPY server.cfg /opt/quake3/baseq3/server.cfg
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

A fancy containerized [quake3](https://en.wikipedia.org/wiki/Quake_III_Arena) dedicated server container. Get playing in no time!

The config I have here is fairly generic but somewhat specific to the overall stock way I play this game with my friends.
The config I have here is fairly generic but somewhat specific to the overall stock way I play this game with my friends. It's definitely ready to play!

Ideally, you would setup the config how you want, build, launch, and play. I source from the excellent [jberrenberg/quake3](https://hub.docker.com/r/jberrenberg/quake3) image.
Ideally, you would setup the config how you want, build, launch, and play. I sourced the `Dockerfile` and `bootstrap.sh` originally from the excellent [jberrenberg/quake3](https://hub.docker.com/r/jberrenberg/quake3) image.

#### Launching

There is an included `docker-compose.yml` that shows the best way to launch this container and how to take care of the core dependencies: the retail `pak0.pk3` and the port forward for `27960/udp`.
There is an included `docker-compose.yml.example` that shows the best way to launch this container and how to take care of the core dependencies: the retail `pak0.pk3` and the port forward for `27960/udp`.

> Note that the server.cfg must be added to the `/opt/quake3/baseq3` directory and then passed to `q3ded` simply as `server.cfg`. You **cannot** just pass a full path to the file.
Expand Down
14 changes: 14 additions & 0 deletions bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env sh

if [ -f "/opt/quake3/baseq3/pak0.pk3" ]
then
if [ -z "$CONFIG" ]; then
su q3a -c "quake3ded +set fs_game ${FS_GAME} $@"
else
su q3a -c "quake3ded +set fs_game ${FS_GAME} +exec ${CONFIG} $@"
fi
else
echo "You need to provide a valid pak0.pk3 e.g. using:"
echo '-v ${PAK0}:/opt/quake3/baseq3/pak0.pk3'
exit 1
fi
2 changes: 1 addition & 1 deletion docker-compose.yml → docker-compose.yml.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
quake3:
image: jberrenberg/quake3
image: inanimate/quake3
restart: always
ports:
- "27960:27960/udp"
Expand Down

0 comments on commit c2f9e2e

Please sign in to comment.