Docker "failed to set up container networking" - Fix Net Setup
Docker could not wire up networking for the container - typically an iptables/bridge issue on the runner, or it ran out of address space to allocate a subnet.
What this error means
A docker run or docker compose up fails with failed to set up container networking, often citing iptables, the bridge, or address-pool exhaustion. Common on nested/Docker-in-Docker runners.
failed to set up container networking: driver failed programming external
connectivity ... (iptables failed)
# or: could not find an available, non-overlapping IPv4 address poolCommon causes
iptables/bridge misconfigured on the runner
Docker programs iptables rules for container connectivity. In restricted or nested environments those rules can fail to apply, breaking network setup.
Address pool exhausted
Many leftover networks consume the default address pools, leaving no non-overlapping subnet for a new network.
Docker-in-Docker / nested networking limits
Running Docker inside a container without the right privileges or kernel modules can prevent bridge networking from initializing.
How to fix it
Reclaim networks and address space
Prune unused networks so a fresh subnet is available.
docker network prune --force
docker network ls # confirm leftovers are goneFix the runner’s networking prerequisites
- For Docker-in-Docker, run the daemon with the privileges and modules it needs (e.g.
--privilegeddind). - Restart the Docker daemon to re-program iptables rules.
- Widen or configure the default address pools if you create many networks.
How to prevent it
- Prune unused networks regularly on long-lived runners.
- Provision Docker-in-Docker with the required privileges and modules.
- Configure address pools when pipelines create many networks.