File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818 - name : " Install latest devcontainer CLI"
1919 run : npm install -g @devcontainers/cli
2020
21- - name : " Generating tests for 'docker-in-docker' which validates if docker daemon is running"
22- run : devcontainer features test --skip-scenarios - f docker-in-docker -i mcr.microsoft.com/devcontainers/base:noble .
21+ - name : " Generating tests for 'docker-in-docker' which validates if docker daemon is running (with iptablesSwitchAtRuntime=true) "
22+ run : devcontainer features test -f docker-in-docker --skip-autogenerated --filter "docker_stress_iptables_runtime" .
2323
2424 test-onCreate :
2525 strategy :
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -e
4+
5+ # Optional: Import test library
6+ source dev-container-features-test-lib
7+
8+ # Stress scenario: validates the docker daemon works when the iptables
9+ # alternative switching is deferred to container start (iptablesSwitchAtRuntime=true).
10+ check " init-script-exists" bash -c " test -f /usr/local/share/docker-init.sh"
11+ check " runtime-iptables-block-present" bash -c " grep -q 'update-alternatives --set iptables' /usr/local/share/docker-init.sh"
12+
13+ check " version" docker --version
14+ check " docker-ps" bash -c " docker ps"
15+ check " log-exists" bash -c " ls /tmp/dockerd.log"
16+ check " log-for-completion" bash -c " cat /tmp/dockerd.log | grep 'Daemon has completed initialization'"
17+ check " log-contents" bash -c " cat /tmp/dockerd.log | grep 'API listen on /var/run/docker.sock'"
18+
19+ # Report result
20+ reportResults
Original file line number Diff line number Diff line change 260260 "features" : {
261261 "docker-in-docker" : {
262262 "version" : " latest" ,
263- "moby" : " false"
263+ "moby" : " false" ,
264+ "iptablesSwitchAtRuntime" : true
264265 }
265266 },
266267 "remoteUser" : " vscode" ,
267268 "onCreateCommand" : " docker ps && sleep 5s && docker ps"
268269 },
270+ // DO NOT REMOVE: This scenario is used by the docker-in-docker-stress-test workflow
271+ "docker_stress_iptables_runtime" : {
272+ "image" : " mcr.microsoft.com/devcontainers/base:noble" ,
273+ "features" : {
274+ "docker-in-docker" : {
275+ "version" : " latest" ,
276+ "moby" : " false" ,
277+ "iptablesSwitchAtRuntime" : true
278+ }
279+ }
280+ },
269281 "azure_linux" : {
270282 "image" : " mcr.microsoft.com/azurelinux/base/core:3.0" ,
271283 "features" : {
You can’t perform that action at this time.
0 commit comments