Jyothish
Jyothish

Reputation: 1133

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.

Upvotes: 10

Views: 30596

Answers (2)

Anton
Anton

Reputation: 161

Create file /etc/docker/daemon.json

{
    "bridge": "none"
}

And restart docker: systemctl restart docker

Upvotes: 16

Jyothish
Jyothish

Reputation: 1133

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.

Upvotes: 7

Related Questions