Create boot2docker instance and start it
$ boot2docker init --dhcp=false --hostip=172.16.0.1
$ boot2docker up
$ boot2docker ssh
$ sudo cp /opt/bootlocal.sh /Users/{username}/
Edit the bootlocal.sh
now in your home to add this line:
ifconfig eth1 172.16.0.11 netmask 255.255.0.0
Now create a profile
file with this content:
DOCKER_TLS=no
EXTRA_ARGS="--bip=172.17.42.1/16 --dns=172.17.42.1"
Go back into the boot2docker ssh
$ sudo cp /Users/{username}/bootlocal.sh /var/lib/boot2docker/
$ sudo cp /Users/{usename}/profile /var/lib/boot2docker/profile
$ exit
$ boot2docker restart
$ sudo route -n add 172.17.0.0/16 172.16.0.11
Check that it worked:
$ ping -c1 172.16.0.11
PING 172.16.0.11 (172.16.0.11): 56 data bytes
64 bytes from 172.16.0.11: icmp_seq=0 ttl=64 time=3.484 ms
--- 172.16.0.11 ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 3.484/3.484/3.484/0.000 ms
$ docker version
Client version: 1.6.2
Client API version: 1.18
Go version (client): go1.4.2
Git commit (client): 7c8fca2
OS/Arch (client): darwin/amd64
Server version: 1.6.2
Server API version: 1.18
Go version (server): go1.4.2
Git commit (server): 7c8fca2
OS/Arch (server): linux/amd64