-
Stop docker daemon:
sudo systemctl stop docker
-
Override the docker daemon startup options via systemd by adding a conf file
sudo mkdir -p /etc/systemd/system/docker.service.d sudo vim /etc/systemd/system/docker.service.d/docker.conf
-
Override the
ExecStart
command and add the--bip
option[Service] ExecStart= ExecStart=/usr/bin/dockerd -H fd:// --bip=198.18.0.1/24
-
Install bridge-utils:
sudo apt-get install -y bridge-utils
-
Bring down and delete the docker0 bridge.
sudo ip link set down docker0 sudo brctl delbr docker0
-
Reload systemd daemon:
sudo systemctl daemon-reload
-
Start docker:
sudo systemctl start docker
Note:
If you created bridged other than docker0 you need to use docker command, docker network rm ...
to remove them (i.e. the brctl delbr ...
command is not enough because the docker daemon will recreate them).