You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Alpine 3.21, all the iptables binaries are located in /usr/sbin (rather than /sbin in 3.20). So this part of the Dockerfile creates "dangling symlinks":
running iptables actually runs /usr/sbin/iptables, which is not what is intended.
This issue could be fixed with a simple:
cd /usr/sbin
N.B.
Depending on the host system, iptables may work out of the box (for example on macOS 15.2), whereas on a Synology NAS (Linux 4.4), iptables -L yields
# Warning: iptables-legacy tables present, use iptables-legacy to see them
iptables v1.8.10 (nf_tables): Could not fetch rule set generation id: Invalid argument
Expected Behavior
iptables should work correctly on any platform by using the legacy implementation, which is more widely supported across different kernels. The Dockerfile's symlink setup is specifically intended to ensure this by forcing the use of iptables-legacy. When running iptables -L, it should display the chains and rules without errors, regardless of whether the host system fully supports nftables or not.
Verify that the symlinks in /sbin are broken (they point to non-existent files):
root@711ecb274314:/# ls -L /sbin/iptables*
ls: cannot access '/sbin/iptables': No such file or directory
ls: cannot access '/sbin/iptables-restore': No such file or directory
ls: cannot access '/sbin/iptables-save': No such file or directory
Locate where the iptables binaries actually reside:
N.B. Depending on your host, you might encounter an error using iptables -L, e.g.
# Warning: iptables-legacy tables present, use iptables-legacy to see them
iptables v1.8.10 (nf_tables): Could not fetch rule set generation id: Invalid argument
Environment
Environment 1:
- OS: macOS 15.2
- How docker service was installed: Docker Desktop v4.37.2 (179585)
Environment 2:
- OS: DSM 7.2.2 (Linux DiskStation 4.4.302+)
- How docker service was installed: Container Manager v24.0.2-1525
Is there an existing issue for this?
Current Behavior
In Alpine 3.21, all the
iptables
binaries are located in/usr/sbin
(rather than/sbin
in 3.20). So this part of the Dockerfile creates "dangling symlinks":Moreover, since
running
iptables
actually runs/usr/sbin/iptables
, which is not what is intended.This issue could be fixed with a simple:
N.B.
Depending on the host system,
iptables
may work out of the box (for example on macOS 15.2), whereas on a Synology NAS (Linux 4.4),iptables -L
yieldsExpected Behavior
iptables should work correctly on any platform by using the legacy implementation, which is more widely supported across different kernels. The Dockerfile's symlink setup is specifically intended to ensure this by forcing the use of iptables-legacy. When running
iptables -L
, it should display the chains and rules without errors, regardless of whether the host system fully supports nftables or not.Steps To Reproduce
Start the container and get a shell:
Verify that the symlinks in
/sbin
are broken (they point to non-existent files):Locate where the iptables binaries actually reside:
N.B. Depending on your host, you might encounter an error using
iptables -L
, e.g.Environment
CPU architecture
x86-64
Docker creation
docker run -it --cap-add=NET_ADMIN \ -e PUID=1000 \ -e PGID=1000 \ -e TZ=Etc/UTC \ -p 51820:51820/udp \ --sysctl="net.ipv4.conf.all.src_valid_mark=1" \ lscr.io/linuxserver/wireguard:latest bash
Container logs
The text was updated successfully, but these errors were encountered: