From 3a09302b501fd2da4a0e68a20e61e1d7650948af Mon Sep 17 00:00:00 2001 From: v-Kaniska244 <186041440+v-Kaniska244@users.noreply.github.com> Date: Mon, 23 Nov 2026 06:21:35 +0000 Subject: [PATCH 1/4] Initial plan From 3a0a87b83c4e28c3cf517adc5f9a4ac8e13da2f1 Mon Sep 17 00:00:00 2001 From: v-Kaniska244 <186041440+v-Kaniska244@users.noreply.github.com> Date: Mon, 23 Nov 2026 06:23:08 +0000 Subject: [PATCH 2/4] Silence missing proc modules diagnostic Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> --- src/docker-in-docker/devcontainer-feature.json | 2 +- src/docker-in-docker/install.sh | 2 +- test/docker-in-docker/docker_iptables_switch_at_runtime.sh | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/docker-in-docker/devcontainer-feature.json b/src/docker-in-docker/devcontainer-feature.json index b6f7d1611..805eb4dc9 100644 --- a/src/docker-in-docker/devcontainer-feature.json +++ b/src/docker-in-docker/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "docker-in-docker", - "version": "4.1.3", + "version": "4.1.4", "name": "Docker (Docker-in-Docker)", "documentationURL": "https://github.com/devcontainers/features/tree/main/src/docker-in-docker", "description": "Create child containers *inside* a container, independent from the host's docker instance. Installs Docker extension in the container along with needed CLIs.", diff --git a/src/docker-in-docker/install.sh b/src/docker-in-docker/install.sh index 61f94f77a..aa5e7786b 100755 --- a/src/docker-in-docker/install.sh +++ b/src/docker-in-docker/install.sh @@ -1008,7 +1008,7 @@ if [ "${IPTABLES_SWITCH_AT_RUNTIME}" = "true" ] && [ "${ADJUSTED_ID}" = "debian" # and would defeat hosts/scenarios where the module is intentionally absent # such as the newer kernels which leaves out ip_tables legacy.) if type iptables-legacy > /dev/null 2>&1 \ - && { grep -qE '^(ip_tables)\b' /proc/modules \ + && { grep -qE '^(ip_tables)\b' /proc/modules 2>/dev/null \ || [ -d /sys/module/ip_tables ]; } \ && update-alternatives --list iptables 2>/dev/null | grep -q '/usr/sbin/iptables-legacy'; then sudo_if update-alternatives --set iptables /usr/sbin/iptables-legacy || true diff --git a/test/docker-in-docker/docker_iptables_switch_at_runtime.sh b/test/docker-in-docker/docker_iptables_switch_at_runtime.sh index 152a4ec98..25ad2296e 100644 --- a/test/docker-in-docker/docker_iptables_switch_at_runtime.sh +++ b/test/docker-in-docker/docker_iptables_switch_at_runtime.sh @@ -11,6 +11,7 @@ check "init-script-exists" bash -c "test -f /usr/local/share/docker-init.sh" check "runtime-iptables-block-present" bash -c "grep -q 'update-alternatives --set iptables' /usr/local/share/docker-init.sh" check "runtime-iptables-block-has-legacy-branch" bash -c "grep -q '/usr/sbin/iptables-legacy' /usr/local/share/docker-init.sh" check "runtime-iptables-block-has-nft-branch" bash -c "grep -q '/usr/sbin/iptables-nft' /usr/local/share/docker-init.sh" +check "runtime-iptables-proc-modules-check-is-quiet" bash -c "grep -q '/proc/modules 2>/dev/null' /usr/local/share/docker-init.sh" # The runtime block runs as part of docker-init.sh (the feature's entrypoint), # so by the time these tests execute the alternative must already be set. From a6659004db0463628afd0ebc44902d94c2c158f9 Mon Sep 17 00:00:00 2001 From: Kaniska Date: Mon, 23 Nov 2026 09:33:26 +0000 Subject: [PATCH 3/4] Check if iptables installed for the failing scenario --- .../docker_iptables_switch_at_runtime_non_root.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/test/docker-in-docker/docker_iptables_switch_at_runtime_non_root.sh b/test/docker-in-docker/docker_iptables_switch_at_runtime_non_root.sh index 7a957b55d..008184303 100644 --- a/test/docker-in-docker/docker_iptables_switch_at_runtime_non_root.sh +++ b/test/docker-in-docker/docker_iptables_switch_at_runtime_non_root.sh @@ -6,6 +6,7 @@ set -e source dev-container-features-test-lib check "entrypoint runs as codespace" bash -c "test \"$(id -un)\" = codespace" +check "iptables version" iptables --version check "iptables uses legacy backend" bash -c "iptables --version | grep -q '(legacy)'" # Report result From 4aa6827a83e1cf24ce36898dae3f96bb4dd073f6 Mon Sep 17 00:00:00 2001 From: Kaniska Date: Mon, 23 Nov 2026 10:17:41 +0000 Subject: [PATCH 4/4] Modify the test as the GH runner image updated to ubuntu 26.04 where iptables-nft is default. --- .../docker_iptables_switch_at_runtime_non_root.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/docker-in-docker/docker_iptables_switch_at_runtime_non_root.sh b/test/docker-in-docker/docker_iptables_switch_at_runtime_non_root.sh index 008184303..cc1d2e7ae 100644 --- a/test/docker-in-docker/docker_iptables_switch_at_runtime_non_root.sh +++ b/test/docker-in-docker/docker_iptables_switch_at_runtime_non_root.sh @@ -7,7 +7,10 @@ source dev-container-features-test-lib check "entrypoint runs as codespace" bash -c "test \"$(id -un)\" = codespace" check "iptables version" iptables --version -check "iptables uses legacy backend" bash -c "iptables --version | grep -q '(legacy)'" +# The build-time switch should have set /etc/alternatives/iptables to one of the +# known backends. With the ip_tables module loaded on the host, legacy is preferred. +check "iptables-alternative-set" bash -c "readlink /etc/alternatives/iptables | grep -E 'iptables-(legacy|nft)$'" +check "iptables works" sudo iptables -L # Report result reportResults \ No newline at end of file