Skip to content
This repository was archived by the owner on Jul 5, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
146 changes: 82 additions & 64 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,67 +5,77 @@
#

FROM ubuntu:18.04

LABEL maintainer="LinuxGSM <[email protected]>"

ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* \
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
RUN set -ex; \
apt-get update; \
apt-get install -y locales; \
rm -rf /var/lib/apt/lists/*; \
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8

ENV LANG en_US.utf8

## Base System
RUN dpkg --add-architecture i386 && \
apt update -y && \
apt install -y \
mailutils \
postfix \
curl \
wget \
file \
tar \
bzip2 \
gzip \
unzip \
bsdmainutils \
python \
util-linux \
binutils \
bc \
jq \
tmux \
lib32gcc1 \
libstdc++6 \
libstdc++6:i386 \
apt-transport-https \
ca-certificates \
telnet \
expect \
libncurses5:i386 \
libcurl4-gnutls-dev:i386 \
libstdc++5:i386 \
lib32tinfo5 \
xz-utils \
zlib1g:i386 \
libldap-2.4-2:i386 \
lib32z1 \
default-jre \
speex:i386 \
libtbb2 \
libxrandr2:i386 \
libglu1-mesa:i386 \
libxtst6:i386 \
libusb-1.0-0:i386 \
libopenal1:i386 \
libpulse0:i386 \
libdbus-glib-1-2:i386 \
libnm-glib4:i386 \
zlib1g \
libssl1.0.0:i386 \
libtcmalloc-minimal4:i386 \
libsdl1.2debian \
libnm-glib-dev:i386 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN set -ex; \
dpkg --add-architecture i386; \
apt update -y; \
apt install -y \
apt-transport-https \
bc \
binutils \
bsdmainutils \
bzip2 \
ca-certificates \
curl \
default-jre \
expect \
file \
gzip \
iproute2 \
jq \
lib32gcc1 \
lib32stdc++6 \
lib32tinfo5 \
lib32z1 \
libcurl4-gnutls-dev:i386 \
libdbus-glib-1-2:i386 \
libglu1-mesa:i386 \
libldap-2.4-2:i386 \
libncurses5:i386 \
libnm-glib-dev:i386 \
libnm-glib4:i386 \
libopenal1:i386 \
libpulse0:i386 \
libsdl1.2debian \
libsdl2-2.0-0:i386 \
libssl1.0.0:i386 \
libstdc++5:i386 \
libstdc++6 \
libstdc++6:i386 \
libtbb2 \
libtcmalloc-minimal4:i386 \
libusb-1.0-0:i386 \
libxrandr2:i386 \
libxtst6:i386 \
mailutils \
netcat \
postfix \
python \
speex:i386 \
telnet \
tmux \
unzip \
util-linux \
vim \
wget \
xz-utils \
zlib1g \
zlib1g:i386; \
apt-get clean; \
rm -rf /var/lib/apt/lists/*

## linuxgsm.sh
RUN wget https://linuxgsm.com/dl/linuxgsm.sh
Expand All @@ -84,17 +94,20 @@ RUN adduser \
USER linuxgsm

## user config
RUN groupadd -g 750 -o linuxgsm && \
adduser --uid 750 --disabled-password --gecos "" --ingroup linuxgsm linuxgsm && \
chown linuxgsm:linuxgsm /linuxgsm.sh && \
chmod +x /linuxgsm.sh && \
cp /linuxgsm.sh /home/linuxgsm/linuxgsm.sh && \
usermod -G tty linuxgsm && \
chown -R linuxgsm:linuxgsm /home/linuxgsm/ && \
chmod 755 /home/linuxgsm
RUN set -ex; \
groupadd -g 750 -o linuxgsm; \
adduser --uid 750 --disabled-password --gecos "" --ingroup linuxgsm linuxgsm; \
chown linuxgsm:linuxgsm /linuxgsm.sh; \
chmod +x /linuxgsm.sh; \
cp /linuxgsm.sh /home/linuxgsm/linuxgsm.sh; \
usermod -G tty linuxgsm; \
chown -R linuxgsm:linuxgsm /home/linuxgsm/; \
chmod 777 /home/linuxgsm

USER linuxgsm

WORKDIR /home/linuxgsm

VOLUME [ "/home/linuxgsm" ]

# need use xterm for LinuxGSM
Expand All @@ -103,5 +116,10 @@ ENV TERM=xterm
## Docker Details
ENV PATH=$PATH:/home/linuxgsm

COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["bash","/entrypoint.sh" ]
COPY --chown=linuxgsm:linuxgsm entrypoint.sh installserver.sh /home/linuxgsm

RUN chmod +x *.sh

ENTRYPOINT ["bash","./entrypoint.sh" ]

CMD ["./installserver.sh"]
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017 Andrey Shmakov
Copyright (c) 2017-2020 Daniel Gibbs

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ This will work both on linux and Docker for Windows. With Docker for Windows, sk

```bash
$ mkdir -p /path/to/lgsm && sudo chown -R 750:750 /path/to/lgsm
$ docker run --name lgsm-docker --restart always --net=host --hostname LGSM -it -v "/path/to/lgsm:/home/lgsm/" gameservermanagers/linuxgsm-docker
$ docker run -d --name lgsm-docker --restart always --net=host --hostname LGSM -it -v "/path/to/lgsm:/home/lgsm/" gameservermanagers/linuxgsm-docker
```
To expose multiple game ports for your server use the format `-p <start-stop>:<start-stop>`. For example `docker run -d --name <server name> -p 12203-12204:12203-12204 --restart-always --net=host gameservermanagers/linuxgsm-docker `
12 changes: 12 additions & 0 deletions compose-dev.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## DOCKER COMPOSE DRAFT

# Overview
The docker image dockclair/lgsm-dev has been modified for use with docker-compose by adding a bootstrap-like sh script.

For this to work the environment variable 'GAMESERVER' needs to be set and match
a valid (supported) LinuxGSM server.

All questions posed to the user will be answered with the default 'yes'

# Issues
No PID 1 constantly running for the container to remain up even with -d or the entrypoint's use of tmux. We need a process to remain running as PID 1 so it doesn't die immediately after starting the game server.
15 changes: 15 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: '3.9'

services:
lgsm_test:
image: dockclair/lgsm-dev
environment:
- GAMESERVER=vhserver
ports:
- 2456:2456
volumes:
- type: volume
target: /home/linuxgsm

volumes:
lgsm:
4 changes: 3 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ else
# when invoked via docker run
# but requires -it or at least -t
tmux set -g status off && tmux attach 2> /dev/null


fi

exit 0
exit 0
5 changes: 5 additions & 0 deletions installserver.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
./linuxgsm.sh $GAMESERVER
yes | ./$GAMESERVER install
./$GAMESERVER start