Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add property mapping for force-gamemode #406

Merged
merged 2 commits into from
Apr 4, 2024
Merged
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
24 changes: 4 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,10 @@ ARG TARGETOS
ARG TARGETARCH
ARG TARGETVARIANT

RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
curl \
openssl \
unzip \
jq \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Install box64 on arm
RUN if [ "$TARGETARCH" = "arm64" ] ; then \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y debian-keyring && \
curl -L https://ryanfortner.github.io/box64-debs/box64.list -o /etc/apt/sources.list.d/box64.list && \
curl -L https://ryanfortner.github.io/box64-debs/KEY.gpg | gpg --dearmor | tee /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y box64-arm64 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* ;\
fi
RUN --mount=target=/build,source=build /build/install-packages

ARG BOX64_PACKAGE=box64
RUN --mount=target=/build,source=build BOX64_PACKAGE=$BOX64_PACKAGE /build/setup-arm64

EXPOSE 19132/udp

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ The following environment variables will set the equivalent property in `server.
- `SERVER_PORT`
- `SERVER_PORT_V6`
- `GAMEMODE`
- `FORCE_GAMEMODE`
- `DIFFICULTY`
- `LEVEL_TYPE`
- `ALLOW_CHEATS`
Expand Down
15 changes: 15 additions & 0 deletions build/install-packages
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

set -eu

apt-get update

DEBIAN_FRONTEND=noninteractive apt-get install -y \
curl \
openssl \
unzip \
jq

apt-get clean

rm -rf /var/lib/apt/lists/*
17 changes: 17 additions & 0 deletions build/setup-arm64
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

set -eu

if [ "$TARGETARCH" = "arm64" ] ; then
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y debian-keyring

curl -L https://ryanfortner.github.io/box64-debs/box64.list -o /etc/apt/sources.list.d/box64.list
curl -L https://ryanfortner.github.io/box64-debs/KEY.gpg | gpg --dearmor | tee /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg

apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y "$BOX64_PACKAGE"

apt-get clean
rm -rf /var/lib/apt/lists/*
fi
4 changes: 4 additions & 0 deletions property-definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
"2": "adventure"
}
},
"force-gamemode": {
"env": "FORCE_GAMEMODE",
"allowed": ["true","false"]
},
"difficulty": {
"env": "DIFFICULTY",
"allowed": ["easy","peaceful","normal","hard"],
Expand Down
Loading