Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 306
Jyothish Avatar asked Dec 14 '22 15:12

Jyothish


2 Answers

Create file /etc/docker/daemon.json

{
    "bridge": "none"
}

And restart docker: systemctl restart docker

like image 171
Anton Avatar answered Dec 16 '22 03:12

Anton


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.

like image 30
Jyothish Avatar answered Dec 16 '22 03:12

Jyothish