'How to delete/disable docker0 bridge on docker startup
Is there any way we can disable docker0 bridge on docker startup ?
Tried "bridge": "none" in daemon.json but its not working.
Also removed default docker bridge using "ip link delete docker0" but when we restart docker it came up automatically. So any permanent way to disable/delete default docker bridge on startup ? I see the same question here How to delete interface docker0 but I already tried that and whenever docker is restarted the docker0 bridge came back.
Solution 1:[1]
I think I found the answer. Inorder to disable the default bridge network add "bridge": "none"
in daemon.json
and restart docker service. The changes will taken effect immediately if there are no running containers. In my case there were some containers already running, so changes not taken effect. After inspecting the log, could see that info msg="There are old running containers, the network config will not take affect"
So I stopped the running container and restarted the docker service. After that bridge network is disabled. Hope this help someone.
Solution 2:[2]
Create file /etc/docker/daemon.json
{
"bridge": "none"
}
And restart docker:
systemctl restart docker
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | |
Solution 2 | meetnick |