From ee5c0484bba6ff1f05a7f3eefc87af545e91083e Mon Sep 17 00:00:00 2001 From: Stephen Mott Date: Sat, 2 May 2026 23:29:35 +0800 Subject: [PATCH 1/2] fix(devcontainer): fix devcontainer under ubuntu 26.04 - iptables changes nat': Table does not exist (do you need to insmod?)\nPerhaps iptables or your kernel needs to be upgraded.\n (exit status 3) --- src/docker-in-docker/install.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/docker-in-docker/install.sh b/src/docker-in-docker/install.sh index 5af320b0b..2d697923b 100755 --- a/src/docker-in-docker/install.sh +++ b/src/docker-in-docker/install.sh @@ -310,10 +310,16 @@ if [ "${ADJUSTED_ID}" = "debian" ] && command -v update-ca-certificates > /dev/n update-ca-certificates fi -# Swap to legacy iptables for compatibility (Debian only) if [ "${ADJUSTED_ID}" = "debian" ] && type iptables-legacy > /dev/null 2>&1; then - update-alternatives --set iptables /usr/sbin/iptables-legacy - update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy + # Check if host kernel supports ip_tables/iptable_nat + if iptables-legacy -t nat -L > /dev/null 2>&1; then + update-alternatives --set iptables /usr/sbin/iptables-legacy + update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy + else + # first appeared in Ubuntu ≥ 26.04 + update-alternatives --set iptables /usr/sbin/iptables-nft + update-alternatives --set ip6tables /usr/sbin/ip6tables-nft + fi fi # Set up the necessary repositories From 2af1765fb586ea9222181c12d8c16e6e3fcb1d75 Mon Sep 17 00:00:00 2001 From: Stephen Mott Date: Sun, 3 May 2026 00:07:51 +0800 Subject: [PATCH 2/2] comment(docker-in-docker): add back the comment that I accidently removed --- src/docker-in-docker/install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/src/docker-in-docker/install.sh b/src/docker-in-docker/install.sh index 2d697923b..a66296e03 100755 --- a/src/docker-in-docker/install.sh +++ b/src/docker-in-docker/install.sh @@ -310,6 +310,7 @@ if [ "${ADJUSTED_ID}" = "debian" ] && command -v update-ca-certificates > /dev/n update-ca-certificates fi +# Swap to legacy iptables for compatibility (Debian only) if [ "${ADJUSTED_ID}" = "debian" ] && type iptables-legacy > /dev/null 2>&1; then # Check if host kernel supports ip_tables/iptable_nat if iptables-legacy -t nat -L > /dev/null 2>&1; then