fix: use ln -sf instead of update-alternatives --set

update-alternatives --set fails because the base image only registers
iptables-legacy as an alternative. The iptables-nft binary (/usr/sbin/iptables-nft)
exists but isn't in the alternatives database. Direct ln -sf bypasses this.
This commit is contained in:
2026-05-13 12:58:43 -04:00
parent ec08f5eb5d
commit 8dff094768

View File

@@ -2,8 +2,8 @@
# Fixes crash-loop when host kernel lacks legacy iptable_nat module. # Fixes crash-loop when host kernel lacks legacy iptable_nat module.
FROM ghcr.io/wg-easy/wg-easy:latest FROM ghcr.io/wg-easy/wg-easy:latest
# The upstream image defaults to iptables-legacy via update-alternatives. # The upstream image registers only iptables-legacy with update-alternatives.
# Switch iptables to the nftables backend (already provided by the 'iptables' # iptables-nft binary exists but isn't registered as an alternative key.
# package on Alpine 3.18+). No apk add needed — iptables-nft is built-in. # Override the alternatives-managed symlinks directly.
RUN update-alternatives --set iptables /usr/sbin/iptables-nft && \ RUN ln -sf /usr/sbin/iptables-nft /usr/sbin/iptables && \
update-alternatives --set ip6tables /usr/sbin/ip6tables-nft ln -sf /usr/sbin/ip6tables-nft /usr/sbin/ip6tables