Skip to content
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
2 changes: 0 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 17 additions & 5 deletions build/alpine/install-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion build/ubuntu/install-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thnx

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Must it not be == ?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's old school sh/bash in this particular script, but I'll double check

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...well the test build was happy 😄

@itzg itzg Jul 27, 2026

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, for maximum portability single equal sign is preferred since POSIX sh uses that. Note it is a [ ... ] operator. If it was double square brackets, [[ a == b ]] then == is needed.

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
Expand Down