mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-02-18 07:26:24 +00:00
Compare commits
10 Commits
test/2421
...
feat/nativ
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fbb2a0d8d7 | ||
|
|
ee562599f4 | ||
|
|
1ffcb5c221 | ||
|
|
8cdf4d0072 | ||
|
|
1545236cc6 | ||
|
|
2ebcc0fe00 | ||
|
|
e5f818bdf1 | ||
|
|
df497ce3d8 | ||
|
|
f7ff2779d9 | ||
|
|
c9e14864f5 |
32
Dockerfile
32
Dockerfile
@@ -1,6 +1,19 @@
|
||||
# syntax = docker/dockerfile:1.3
|
||||
|
||||
# syntax = docker/dockerfile:1.5-labs
|
||||
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}
|
||||
|
||||
# hook into docker BuildKit --platform support
|
||||
@@ -9,11 +22,14 @@ ARG TARGETOS
|
||||
ARG TARGETARCH
|
||||
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 \
|
||||
/build/run.sh setup-user
|
||||
REV=${BUILD_FILES_REV} TARGET=${TARGETARCH}${TARGETVARIANT} /build/run.sh install-packages
|
||||
|
||||
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
|
||||
|
||||
@@ -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}} \
|
||||
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||
|
||||
ARG MC_HELPER_VERSION=1.36.1
|
||||
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
|
||||
COPY --from=helper-native-builder /helper/build/native/nativeCompile/mc-image-helper /usr/bin/
|
||||
|
||||
VOLUME ["/data"]
|
||||
WORKDIR /data
|
||||
|
||||
@@ -26,12 +26,9 @@ apk add --no-cache -U \
|
||||
zstd \
|
||||
nfs-utils \
|
||||
libpcap \
|
||||
libwebp \
|
||||
libcap
|
||||
libwebp
|
||||
|
||||
# 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
|
||||
tar -xf /tmp/knock.tar.gz -C /usr/local/ && rm /tmp/knock.tar.gz
|
||||
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
|
||||
tar -xf /tmp/knock.tar.gz -C /usr/local/ && rm /tmp/knock.tar.gz
|
||||
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
|
||||
tar -xf /tmp/knock.tar.gz -C /usr/local/ && rm /tmp/knock.tar.gz
|
||||
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 \;
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
- `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.
|
||||
- `AUTOPAUSE_SUDO`, default "true"
|
||||
specifies if the knockd service should be run via sudo in order to elevate its privileges
|
||||
|
||||
!!! tip
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
mkdocs == 1.5.3
|
||||
mkdocs-material-extensions == 1.2
|
||||
mkdocs-material == 9.4.3
|
||||
mkdocs-material == 9.4.6
|
||||
mkdocs-autorefs == 0.5.0
|
||||
mkdocstrings == 0.23.0
|
||||
mkdocs-literate-nav == 0.6.1
|
||||
mdx-gh-links == 0.3.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)
|
||||
fi
|
||||
|
||||
if isTrue "${AUTOPAUSE_SUDO:-true}"; then
|
||||
sudo /usr/local/sbin/knockd "${knockdArgs[@]}"
|
||||
else
|
||||
/usr/local/sbin/knockd "${knockdArgs[@]}"
|
||||
fi
|
||||
sudo /usr/local/sbin/knockd "${knockdArgs[@]}"
|
||||
if [ $? -ne 0 ] ; then
|
||||
logAutopause "Failed to start knockd daemon."
|
||||
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 isFamily HYBRID FORGE; then
|
||||
loader=forge
|
||||
elif isFamily FABRIC; then
|
||||
loader=fabric
|
||||
else
|
||||
# we're left with Bukkit/Spigot down-lines where plugins seem to be
|
||||
loader="${TYPE,,}"
|
||||
fi
|
||||
mc-image-helper modrinth \
|
||||
|
||||
@@ -5,6 +5,10 @@ IFS=$'\n\t'
|
||||
: "${EXISTING_OPS_FILE:=SKIP}"
|
||||
: "${EXISTING_WHITELIST_FILE:=SKIP}"
|
||||
|
||||
# shellcheck source=start-utils
|
||||
. "${SCRIPTS:-/}start-utils"
|
||||
isDebugging && set -x
|
||||
|
||||
if [[ -v APPEND_OPS ]] && isTrue "${APPEND_OPS}"; then
|
||||
EXISTING_OPS_FILE=MERGE
|
||||
elif [[ -v OVERRIDE_OPS ]] && isTrue "${OVERRIDE_OPS}"; then
|
||||
@@ -17,10 +21,6 @@ elif [[ -v OVERRIDE_WHITELIST ]] && isTrue "${OVERRIDE_WHITELIST}"; then
|
||||
EXISTING_WHITELIST_FILE=SYNCHRONIZE
|
||||
fi
|
||||
|
||||
# shellcheck source=start-utils
|
||||
. "${SCRIPTS:-/}start-utils"
|
||||
isDebugging && set -x
|
||||
|
||||
sharedArgs=(--version="$VERSION")
|
||||
if isFalse "${ONLINE_MODE:-true}"; then
|
||||
sharedArgs+=( --offline )
|
||||
|
||||
@@ -28,9 +28,6 @@ function customizeServerProps {
|
||||
MOTD="{\"text\":\"${MOTD}\"}"
|
||||
fi
|
||||
fi
|
||||
if [[ $MOTD ]]; then
|
||||
MOTD="$(echo "$MOTD" | mc-image-helper asciify)"
|
||||
fi
|
||||
|
||||
if [[ -v MODE ]]; then
|
||||
log "Setting mode"
|
||||
|
||||
0
tests/setuponlytests/cf_files/require.sh
Normal file → Executable file
0
tests/setuponlytests/cf_files/require.sh
Normal file → Executable file
0
tests/setuponlytests/conflicting_world_for_spigot_server/require.sh
Normal file → Executable file
0
tests/setuponlytests/conflicting_world_for_spigot_server/require.sh
Normal file → Executable file
0
tests/setuponlytests/conflicting_world_for_vanilla_server/require.sh
Normal file → Executable file
0
tests/setuponlytests/conflicting_world_for_vanilla_server/require.sh
Normal file → Executable file
0
tests/setuponlytests/curseforge/require.sh
Normal file → Executable file
0
tests/setuponlytests/curseforge/require.sh
Normal file → Executable file
0
tests/setuponlytests/icon-file-exact/require.sh
Normal file → Executable file
0
tests/setuponlytests/icon-file-exact/require.sh
Normal file → Executable file
0
tests/setuponlytests/icon-gif-multiframe/require.sh
Normal file → Executable file
0
tests/setuponlytests/icon-gif-multiframe/require.sh
Normal file → Executable file
0
tests/setuponlytests/icon-png-atscale/require.sh
Normal file → Executable file
0
tests/setuponlytests/icon-png-atscale/require.sh
Normal file → Executable file
0
tests/setuponlytests/pufferfish/require.sh
Normal file → Executable file
0
tests/setuponlytests/pufferfish/require.sh
Normal file → Executable file
0
tests/setuponlytests/quilt/require.sh
Normal file → Executable file
0
tests/setuponlytests/quilt/require.sh
Normal file → Executable file
1
tests/setuponlytests/spiget/require.sh
Executable file
1
tests/setuponlytests/spiget/require.sh
Executable file
@@ -0,0 +1 @@
|
||||
[[ $EXTENDED_TESTS ]] || exit 1
|
||||
0
tests/setuponlytests/spigot_world_for_vanilla_server/require.sh
Normal file → Executable file
0
tests/setuponlytests/spigot_world_for_vanilla_server/require.sh
Normal file → Executable file
0
tests/setuponlytests/spongevanilla_version_compare/require.sh
Normal file → Executable file
0
tests/setuponlytests/spongevanilla_version_compare/require.sh
Normal file → Executable file
0
tests/setuponlytests/test.sh
Normal file → Executable file
0
tests/setuponlytests/test.sh
Normal file → Executable file
0
tests/setuponlytests/vanilla_world_for_spigot_server/require.sh
Normal file → Executable file
0
tests/setuponlytests/vanilla_world_for_spigot_server/require.sh
Normal file → Executable file
0
tests/setuponlytests/vanillatweaks_sharecode/require.sh
Normal file → Executable file
0
tests/setuponlytests/vanillatweaks_sharecode/require.sh
Normal file → Executable file
0
tests/setuponlytests/world_from_tar/require.sh
Normal file → Executable file
0
tests/setuponlytests/world_from_tar/require.sh
Normal file → Executable file
0
tests/setuponlytests/world_from_tarbz2/require.sh
Normal file → Executable file
0
tests/setuponlytests/world_from_tarbz2/require.sh
Normal file → Executable file
0
tests/setuponlytests/world_from_tarzst/require.sh
Normal file → Executable file
0
tests/setuponlytests/world_from_tarzst/require.sh
Normal file → Executable file
Reference in New Issue
Block a user