dind with --network=host silently wipes the host daemon's iptables rules
When docker:dind runs with --network=host on a host that also runs Docker, the inner dockerd wipes the host daemon's iptables rules on startup. Since the iptables-legacy detection from #437, both daemons usually end up on the same nf_tables backend, so they share the same DOCKER* chains. Older setups where dind was on legacy didn't really hit this.
On startup dockerd flushes and deletes its chains (DOCKER, DOCKER-FORWARD, DOCKER-CT, DOCKER-BRIDGE, nat DOCKER, ...) and recreates them only for its own networks. The host daemon doesn't notice, so containers on its user-defined bridge networks lose outbound access (FORWARD policy is DROP), and published ports lose their DNAT. Nothing gets logged and it stays broken until the host dockerd is restarted. getumbrel/umbrel-apps#5802 is the same thing.
Repro without touching the host (fake "host daemon" rules in the container's own netns):
$ docker run -d --privileged --name repro --entrypoint sh docker:29-dind -c '
iptables -N DOCKER-FORWARD && iptables -A DOCKER-FORWARD -i br-other -j ACCEPT
iptables -N DOCKER && iptables -A DOCKER ! -i br-other -o br-other -j DROP
iptables -t nat -N DOCKER && iptables -t nat -A DOCKER ! -i br-other -p tcp --dport 8080 -j DNAT --to-destination 172.30.0.2:80
exec dockerd-entrypoint.sh'
$ sleep 20; docker exec repro sh -c 'iptables-save | grep -c br-other'
0
I know dind + host networking isn't recommended (#443), and some people use it on purpose, so refusing to start seems too much. But a warning in dockerd-entrypoint.sh when a DOCKER chain already exists before dockerd starts would have saved us a lot of time. I'll open a PR for that.
Closing. The documentation warning is in docker-library/docs#2722 (merged). Not pursuing a code change.