Changing docker0 ip address in Docker for Mac env

docker_macRegular IP address that gives to docker0 interface is 172.17.0.0/16. To change it you should edit daemon.json file.

 

$ cd ~/Library/Containers/com.docker.docker/Data/ git reset –hard

$ vim ~/Library/Containers/com.docker.docker/Data/database/com.docker.driver.amd64-linux/etc/docker/daemon.json

add you IP for example:

{
"bip":"10.0.101.1/24"
}

and make a commit

$ git commit -am “change docker0 IP”

Docker will reload VM automatically.

A useful command  to log in to VM:

$ screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty

login: root

Leave a comment