Skip to content

Commit 513771b

Browse files
author
PacketShepard
committed
Updated Dockerfile to include git submodule recursion
Updated the Dockerfile so that the git pull is tag specific and it includes the submodule inclusion flag. Also updated project to include s6 and run the server process as a user with dropped rights.
1 parent 5731ff5 commit 513771b

3 files changed

Lines changed: 20 additions & 4 deletions

File tree

Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ RUN printf "deb http://deb.debian.org/debian buster-backports main\n" > /etc/apt
1919
libssl-dev \
2020
git \
2121
curl \
22-
ca-certificates && \
23-
git clone --depth 1 --branch master https://github.com/BeamMP/BeamMP-Server.git BeamMP-Server 2>/dev/null
22+
ca-certificates
23+
24+
RUN git clone --depth 1 -b v2.0.3 --recurse-submodules --shallow-submodules https://github.com/BeamMP/BeamMP-Server.git BeamMP-Server
2425

2526
WORKDIR /beammp/BeamMP-Server
2627

@@ -32,6 +33,9 @@ RUN mkdir /beammp
3233

3334
WORKDIR /beammp
3435

36+
ADD https://github.com/just-containers/s6-overlay/releases/download/v2.2.0.1/s6-overlay-amd64-installer /tmp/
37+
RUN chmod +x /tmp/s6-overlay-amd64-installer && /tmp/s6-overlay-amd64-installer /
38+
3539
RUN printf "deb http://deb.debian.org/debian buster-backports main\n" > /etc/apt/sources.list.d/buster-backports.list && \
3640
apt-get update && apt-get install -y --no-install-recommends \
3741
liblua5.3 \

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
[![Docker Pulls](https://img.shields.io/docker/pulls/packetshepard/beammp.svg)][hub]
55

66
# [BeamMP-Server in docker][hub]
7-
BeamMP-Server Auto Builder using Docker with Multi-image Debian 10
7+
BeamMP-Server Auto Builder using Docker with multi-image Debian 10
8+
89
Lightweight final image. Approximately 187 MB.
910

1011
## Usage

entrypoint.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,15 @@ use = "${use}" # Resource file name
1414
AuthKey = "${AuthKey}" # Auth Key
1515
EOF
1616

17-
exec ./BeamMP-Server
17+
USER_NAME=${USER_NAME:-beammp}
18+
19+
PUID=${PUID:-811}
20+
PGID=${PGID:-811}
21+
22+
useradd -M -r -s /usr/sbin/nologin "$USER_NAME"
23+
groupmod -o -g "$PGID" "$USER_NAME"
24+
usermod -o -u "$PUID" "$USER_NAME"
25+
26+
chown "$USER_NAME":"$USER_NAME" /beammp
27+
28+
exec s6-setuidgid ${USER_NAME} ./BeamMP-Server

0 commit comments

Comments
 (0)