Compare commits

...

2 Commits

Author SHA1 Message Date
f184ed957c Merge pull request 'fix: update wg-easy to official ghcr image with iptables-nft' (#26) from fix/vpn-iptables-nft-upstream into master
Reviewed-on: #26
2026-05-13 16:37:35 +00:00
2bf31c7ccc fix: update wg-easy to official ghcr image with iptables-nft
- Switch FROM weejewel/wg-easy:latest (4yr old, Alpine 3.11) to
  ghcr.io/wg-easy/wg-easy:latest (actively maintained, Alpine krypton)
- Use update-alternatives instead of raw ln -sf to flip iptables
  from legacy to nftables backend
- Fix compose build context: ./vpn -> . (Dockerfile was at same level)

The weejewel/wg-easy image lacked iptables-nft package in Alpine 3.11.
The new official image has it available, we just flip the alternatives.
The old ln -sf approach was fragile across Alpine versions.
2026-05-13 12:30:15 -04:00
2 changed files with 8 additions and 14 deletions

View File

@@ -1,16 +1,10 @@
# Custom wg-easy with iptables-nft (nftables-backed iptables) # Custom wg-easy with iptables-nft (nftables-backed iptables)
# Fixes crash-loop when host kernel lacks legacy iptable_nat module. # Fixes crash-loop when host kernel lacks legacy iptable_nat module.
FROM weejewel/wg-easy:latest FROM ghcr.io/wg-easy/wg-easy:latest
# Alpine's iptables-nft provides iptables that uses nftables kernel API # The upstream image defaults to iptables-legacy via update-alternatives.
# instead of the legacy iptable_nat module. This works on kernels # Switch to iptables-nft so it works on kernels where only nftables
# where only nftables netfilter modules are available. # netfilter modules are available (iptable_nat module missing).
RUN apk add --no-cache iptables-nft RUN apk add --no-cache iptables-nft && \
update-alternatives --set iptables /usr/sbin/iptables-nft && \
# Ensure iptables-nft takes priority over legacy iptables update-alternatives --set ip6tables /usr/sbin/ip6tables-nft
RUN ln -sf /sbin/iptables-nft /sbin/iptables && \
ln -sf /sbin/iptables-nft-save /sbin/iptables-save && \
ln -sf /sbin/iptables-nft-restore /sbin/iptables-restore && \
ln -sf /sbin/ip6tables-nft /sbin/ip6tables && \
ln -sf /sbin/ip6tables-nft-save /sbin/ip6tables-save && \
ln -sf /sbin/ip6tables-nft-restore /sbin/ip6tables-restore

View File

@@ -3,7 +3,7 @@ version: "3.8"
services: services:
wireguard: wireguard:
build: build:
context: ./vpn context: .
dockerfile: Dockerfile dockerfile: Dockerfile
image: wg-easy-iptables-nft:latest image: wg-easy-iptables-nft:latest
container_name: wireguard container_name: wireguard