mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-07-31 12:45:57 +00:00
Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fbb2a0d8d7 | ||
|
|
ee562599f4 | ||
|
|
1ffcb5c221 | ||
|
|
8cdf4d0072 | ||
|
|
1545236cc6 | ||
|
|
2ebcc0fe00 | ||
|
|
e5f818bdf1 | ||
|
|
df497ce3d8 | ||
|
|
f7ff2779d9 | ||
|
|
c9e14864f5 |
+21
-11
@@ -1,6 +1,19 @@
|
|||||||
# syntax = docker/dockerfile:1.3
|
# syntax = docker/dockerfile:1.5-labs
|
||||||
|
|
||||||
ARG BASE_IMAGE=eclipse-temurin:17-jre-focal
|
ARG BASE_IMAGE=eclipse-temurin:17-jre-focal
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
FROM container-registry.oracle.com/graalvm/native-image:21-ol8 AS helper-native-builder
|
||||||
|
|
||||||
|
# findutils provides xargs, needed by gradle wrapper
|
||||||
|
RUN microdnf install findutils
|
||||||
|
|
||||||
|
ADD https://github.com/itzg/mc-image-helper.git#feat/graalvm /helper
|
||||||
|
|
||||||
|
WORKDIR /helper
|
||||||
|
|
||||||
|
RUN ./gradlew nativeCompile
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
FROM ${BASE_IMAGE}
|
FROM ${BASE_IMAGE}
|
||||||
|
|
||||||
# hook into docker BuildKit --platform support
|
# hook into docker BuildKit --platform support
|
||||||
@@ -9,11 +22,14 @@ ARG TARGETOS
|
|||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
ARG TARGETVARIANT
|
ARG TARGETVARIANT
|
||||||
|
|
||||||
|
# CI system should set this to a hash or git revision of the build directory and it's contents to
|
||||||
|
# ensure consistent cache updates.
|
||||||
|
ARG BUILD_FILES_REV=1
|
||||||
RUN --mount=target=/build,source=build \
|
RUN --mount=target=/build,source=build \
|
||||||
/build/run.sh setup-user
|
REV=${BUILD_FILES_REV} TARGET=${TARGETARCH}${TARGETVARIANT} /build/run.sh install-packages
|
||||||
|
|
||||||
RUN --mount=target=/build,source=build \
|
RUN --mount=target=/build,source=build \
|
||||||
TARGET=${TARGETARCH}${TARGETVARIANT} /build/run.sh install-packages
|
REV=${BUILD_FILES_REV} /build/run.sh setup-user
|
||||||
|
|
||||||
COPY --chmod=644 files/sudoers* /etc/sudoers.d
|
COPY --chmod=644 files/sudoers* /etc/sudoers.d
|
||||||
|
|
||||||
@@ -39,13 +55,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
|||||||
--var version=1.9.0 --var app=mc-server-runner --file {{.app}} \
|
--var version=1.9.0 --var app=mc-server-runner --file {{.app}} \
|
||||||
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||||
|
|
||||||
ARG MC_HELPER_VERSION=1.36.1
|
COPY --from=helper-native-builder /helper/build/native/nativeCompile/mc-image-helper /usr/bin/
|
||||||
ARG MC_HELPER_BASE_URL=https://github.com/itzg/mc-image-helper/releases/download/${MC_HELPER_VERSION}
|
|
||||||
# used for cache busting local copy of mc-image-helper
|
|
||||||
ARG MC_HELPER_REV=1
|
|
||||||
RUN curl -fsSL ${MC_HELPER_BASE_URL}/mc-image-helper-${MC_HELPER_VERSION}.tgz \
|
|
||||||
| tar -C /usr/share -zxf - \
|
|
||||||
&& ln -s /usr/share/mc-image-helper-${MC_HELPER_VERSION}/bin/mc-image-helper /usr/bin
|
|
||||||
|
|
||||||
VOLUME ["/data"]
|
VOLUME ["/data"]
|
||||||
WORKDIR /data
|
WORKDIR /data
|
||||||
|
|||||||
@@ -26,12 +26,9 @@ apk add --no-cache -U \
|
|||||||
zstd \
|
zstd \
|
||||||
nfs-utils \
|
nfs-utils \
|
||||||
libpcap \
|
libpcap \
|
||||||
libwebp \
|
libwebp
|
||||||
libcap
|
|
||||||
|
|
||||||
# Patched knockd
|
# Patched knockd
|
||||||
curl -fsSL -o /tmp/knock.tar.gz https://github.com/Metalcape/knock/releases/download/0.8.1/knock-0.8.1-alpine-amd64.tar.gz
|
curl -fsSL -o /tmp/knock.tar.gz https://github.com/Metalcape/knock/releases/download/0.8.1/knock-0.8.1-alpine-amd64.tar.gz
|
||||||
tar -xf /tmp/knock.tar.gz -C /usr/local/ && rm /tmp/knock.tar.gz
|
tar -xf /tmp/knock.tar.gz -C /usr/local/ && rm /tmp/knock.tar.gz
|
||||||
ln -s /usr/local/sbin/knockd /usr/sbin/knockd
|
ln -s /usr/local/sbin/knockd /usr/sbin/knockd
|
||||||
setcap cap_net_raw=ep /usr/local/sbin/knockd
|
|
||||||
chown minecraft /usr/local/sbin/knockd
|
|
||||||
|
|||||||
@@ -46,5 +46,3 @@ bash /build/ol/install-gosu.sh
|
|||||||
curl -fsSL -o /tmp/knock.tar.gz https://github.com/Metalcape/knock/releases/download/0.8.1/knock-0.8.1-$TARGET.tar.gz
|
curl -fsSL -o /tmp/knock.tar.gz https://github.com/Metalcape/knock/releases/download/0.8.1/knock-0.8.1-$TARGET.tar.gz
|
||||||
tar -xf /tmp/knock.tar.gz -C /usr/local/ && rm /tmp/knock.tar.gz
|
tar -xf /tmp/knock.tar.gz -C /usr/local/ && rm /tmp/knock.tar.gz
|
||||||
ln -s /usr/local/sbin/knockd /usr/sbin/knockd
|
ln -s /usr/local/sbin/knockd /usr/sbin/knockd
|
||||||
setcap cap_net_raw=ep /usr/local/sbin/knockd
|
|
||||||
chown minecraft /usr/local/sbin/knockd
|
|
||||||
|
|||||||
@@ -35,6 +35,4 @@ apt-get clean
|
|||||||
curl -fsSL -o /tmp/knock.tar.gz https://github.com/Metalcape/knock/releases/download/0.8.1/knock-0.8.1-$TARGET.tar.gz
|
curl -fsSL -o /tmp/knock.tar.gz https://github.com/Metalcape/knock/releases/download/0.8.1/knock-0.8.1-$TARGET.tar.gz
|
||||||
tar -xf /tmp/knock.tar.gz -C /usr/local/ && rm /tmp/knock.tar.gz
|
tar -xf /tmp/knock.tar.gz -C /usr/local/ && rm /tmp/knock.tar.gz
|
||||||
ln -s /usr/local/sbin/knockd /usr/sbin/knockd
|
ln -s /usr/local/sbin/knockd /usr/sbin/knockd
|
||||||
setcap cap_net_raw=ep /usr/local/sbin/knockd
|
|
||||||
chown minecraft /usr/local/sbin/knockd
|
|
||||||
find /usr/lib -name 'libpcap.so.0.8' -execdir cp '{}' libpcap.so.1 \;
|
find /usr/lib -name 'libpcap.so.0.8' -execdir cp '{}' libpcap.so.1 \;
|
||||||
|
|||||||
@@ -24,9 +24,9 @@ renders
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
To produce a multi-line MOTD, you will need to double escape the newline such as
|
To produce a multi-line MOTD, embed a newline character as `\n` in the string, such as
|
||||||
|
|
||||||
-e MOTD="Line one\\nLine two"
|
-e MOTD="Line one\nLine two"
|
||||||
|
|
||||||
### Difficulty
|
### Difficulty
|
||||||
|
|
||||||
|
|||||||
@@ -38,8 +38,6 @@ The following environment variables define the behaviour of auto-pausing:
|
|||||||
describes period of the daemonized state machine, that handles the pausing of the process (resuming is done independently)
|
describes period of the daemonized state machine, that handles the pausing of the process (resuming is done independently)
|
||||||
- `AUTOPAUSE_KNOCK_INTERFACE`, default `eth0`
|
- `AUTOPAUSE_KNOCK_INTERFACE`, default `eth0`
|
||||||
<br>Describes the interface passed to the `knockd` daemon. If the default interface does not work, run the `ifconfig` command inside the container and derive the interface receiving the incoming connection from its output. The passed interface must exist inside the container. Using the loopback interface (`lo`) does likely not yield the desired results.
|
<br>Describes the interface passed to the `knockd` daemon. If the default interface does not work, run the `ifconfig` command inside the container and derive the interface receiving the incoming connection from its output. The passed interface must exist inside the container. Using the loopback interface (`lo`) does likely not yield the desired results.
|
||||||
- `AUTOPAUSE_SUDO`, default "true"
|
|
||||||
specifies if the knockd service should be run via sudo in order to elevate its privileges
|
|
||||||
|
|
||||||
!!! tip
|
!!! tip
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
mkdocs == 1.5.3
|
mkdocs == 1.5.3
|
||||||
mkdocs-material-extensions == 1.2
|
mkdocs-material-extensions == 1.2
|
||||||
mkdocs-material == 9.4.3
|
mkdocs-material == 9.4.6
|
||||||
mkdocs-autorefs == 0.5.0
|
mkdocs-autorefs == 0.5.0
|
||||||
mkdocstrings == 0.23.0
|
mkdocstrings == 0.23.0
|
||||||
mkdocs-literate-nav == 0.6.1
|
mkdocs-literate-nav == 0.6.1
|
||||||
mdx-gh-links == 0.3.1
|
mdx-gh-links == 0.3.1
|
||||||
mkdocs-click == 0.8.1
|
mkdocs-click == 0.8.1
|
||||||
mkdocs-static-i18n == 1.0.6
|
mkdocs-static-i18n == 1.1.1
|
||||||
@@ -45,11 +45,7 @@ if isTrue "${DEBUG_AUTOPAUSE}"; then
|
|||||||
knockdArgs+=(-D)
|
knockdArgs+=(-D)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if isTrue "${AUTOPAUSE_SUDO:-true}"; then
|
sudo /usr/local/sbin/knockd "${knockdArgs[@]}"
|
||||||
sudo /usr/local/sbin/knockd "${knockdArgs[@]}"
|
|
||||||
else
|
|
||||||
/usr/local/sbin/knockd "${knockdArgs[@]}"
|
|
||||||
fi
|
|
||||||
if [ $? -ne 0 ] ; then
|
if [ $? -ne 0 ] ; then
|
||||||
logAutopause "Failed to start knockd daemon."
|
logAutopause "Failed to start knockd daemon."
|
||||||
logAutopause "Probable cause: Unable to attach to interface \"$AUTOPAUSE_KNOCK_INTERFACE\"."
|
logAutopause "Probable cause: Unable to attach to interface \"$AUTOPAUSE_KNOCK_INTERFACE\"."
|
||||||
|
|||||||
@@ -239,10 +239,7 @@ function handleModrinthProjects() {
|
|||||||
if [[ $MODRINTH_PROJECTS ]] && isFamily HYBRID FORGE FABRIC SPIGOT; then
|
if [[ $MODRINTH_PROJECTS ]] && isFamily HYBRID FORGE FABRIC SPIGOT; then
|
||||||
if isFamily HYBRID FORGE; then
|
if isFamily HYBRID FORGE; then
|
||||||
loader=forge
|
loader=forge
|
||||||
elif isFamily FABRIC; then
|
|
||||||
loader=fabric
|
|
||||||
else
|
else
|
||||||
# we're left with Bukkit/Spigot down-lines where plugins seem to be
|
|
||||||
loader="${TYPE,,}"
|
loader="${TYPE,,}"
|
||||||
fi
|
fi
|
||||||
mc-image-helper modrinth \
|
mc-image-helper modrinth \
|
||||||
|
|||||||
@@ -5,6 +5,10 @@ IFS=$'\n\t'
|
|||||||
: "${EXISTING_OPS_FILE:=SKIP}"
|
: "${EXISTING_OPS_FILE:=SKIP}"
|
||||||
: "${EXISTING_WHITELIST_FILE:=SKIP}"
|
: "${EXISTING_WHITELIST_FILE:=SKIP}"
|
||||||
|
|
||||||
|
# shellcheck source=start-utils
|
||||||
|
. "${SCRIPTS:-/}start-utils"
|
||||||
|
isDebugging && set -x
|
||||||
|
|
||||||
if [[ -v APPEND_OPS ]] && isTrue "${APPEND_OPS}"; then
|
if [[ -v APPEND_OPS ]] && isTrue "${APPEND_OPS}"; then
|
||||||
EXISTING_OPS_FILE=MERGE
|
EXISTING_OPS_FILE=MERGE
|
||||||
elif [[ -v OVERRIDE_OPS ]] && isTrue "${OVERRIDE_OPS}"; then
|
elif [[ -v OVERRIDE_OPS ]] && isTrue "${OVERRIDE_OPS}"; then
|
||||||
@@ -17,10 +21,6 @@ elif [[ -v OVERRIDE_WHITELIST ]] && isTrue "${OVERRIDE_WHITELIST}"; then
|
|||||||
EXISTING_WHITELIST_FILE=SYNCHRONIZE
|
EXISTING_WHITELIST_FILE=SYNCHRONIZE
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# shellcheck source=start-utils
|
|
||||||
. "${SCRIPTS:-/}start-utils"
|
|
||||||
isDebugging && set -x
|
|
||||||
|
|
||||||
sharedArgs=(--version="$VERSION")
|
sharedArgs=(--version="$VERSION")
|
||||||
if isFalse "${ONLINE_MODE:-true}"; then
|
if isFalse "${ONLINE_MODE:-true}"; then
|
||||||
sharedArgs+=( --offline )
|
sharedArgs+=( --offline )
|
||||||
|
|||||||
@@ -28,9 +28,6 @@ function customizeServerProps {
|
|||||||
MOTD="{\"text\":\"${MOTD}\"}"
|
MOTD="{\"text\":\"${MOTD}\"}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [[ $MOTD ]]; then
|
|
||||||
MOTD="$(echo "$MOTD" | mc-image-helper asciify)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -v MODE ]]; then
|
if [[ -v MODE ]]; then
|
||||||
log "Setting mode"
|
log "Setting mode"
|
||||||
|
|||||||
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Executable
+1
@@ -0,0 +1 @@
|
|||||||
|
[[ $EXTENDED_TESTS ]] || exit 1
|
||||||
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Reference in New Issue
Block a user