mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-07-27 19:04:53 +00:00
Use Metalcape knockd by default for java25 (#4194)
This commit is contained in:
@@ -46,8 +46,6 @@ jobs:
|
||||
baseImage: eclipse-temurin:25-jre-noble
|
||||
platforms: linux/amd64,linux/arm64,linux/riscv64
|
||||
mcVersion: latest
|
||||
# forked build that include riscv64
|
||||
knockdRepoOrg: Opvolger/knock
|
||||
- variant: java25-alpine
|
||||
baseImage: eclipse-temurin:25-jre-alpine
|
||||
platforms: linux/amd64,linux/arm64
|
||||
|
||||
@@ -3,6 +3,13 @@
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
# Patched knockd is only available for amd64 on Alpine, so install the package for other architectures
|
||||
knockPkg=""
|
||||
if [ "$TARGETARCH" != amd64 ]; then
|
||||
knockPkg="knock"
|
||||
echo "Installing knock package for $TARGETARCH architecture"
|
||||
fi
|
||||
|
||||
# Install necessary packages
|
||||
# shellcheck disable=SC2086
|
||||
apk add --no-cache -U \
|
||||
@@ -36,13 +43,18 @@ apk add --no-cache -U \
|
||||
numactl \
|
||||
jattach \
|
||||
gcompat \
|
||||
"$knockPkg" \
|
||||
${EXTRA_ALPINE_PACKAGES}
|
||||
|
||||
# Download and install patched knockd
|
||||
curl -fsSL -o /tmp/knock.tar.gz "https://github.com/${KNOCKD_REPO_ORG}/releases/download/${KNOCKD_VERSION}/knock-${KNOCKD_VERSION}-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
|
||||
if ! [ "$knockPkg" ]; then
|
||||
# Download and install patched knockd
|
||||
knockdUrl="https://github.com/${KNOCKD_REPO_ORG}/releases/download/${KNOCKD_VERSION}/knock-${KNOCKD_VERSION}-alpine-amd64.tar.gz"
|
||||
echo "Downloading knockd from $knockdUrl"
|
||||
curl -fsSL -o /tmp/knock.tar.gz "$knockdUrl"
|
||||
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
|
||||
fi
|
||||
|
||||
# Set Git credentials globally
|
||||
cat <<EOF >> /etc/gitconfig
|
||||
|
||||
@@ -37,8 +37,13 @@ apt-get install -y \
|
||||
# Clean up APT when done
|
||||
apt-get clean
|
||||
|
||||
if [ "$TARGETARCH" = riscv64 ]; then
|
||||
KNOCKD_REPO_ORG=Opvolger/knock
|
||||
fi
|
||||
# Download and install patched knockd
|
||||
curl -fsSL -o /tmp/knock.tar.gz "https://github.com/${KNOCKD_REPO_ORG}/releases/download/${KNOCKD_VERSION}/knock-${KNOCKD_VERSION}-$TARGET.tar.gz"
|
||||
knockdUrl="https://github.com/${KNOCKD_REPO_ORG}/releases/download/${KNOCKD_VERSION}/knock-${KNOCKD_VERSION}-$TARGET.tar.gz"
|
||||
echo "Downloading knockd from $knockdUrl"
|
||||
curl -fsSL -o /tmp/knock.tar.gz "$knockdUrl"
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user