Skip to content

Instantly share code, notes, and snippets.

@luislavena
Last active May 13, 2018 16:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luislavena/8bc081f90d8341ef7d9fae98870e4a58 to your computer and use it in GitHub Desktop.
Save luislavena/8bc081f90d8341ef7d9fae98870e4a58 to your computer and use it in GitHub Desktop.
Setup fixed IP for docker-machine (boot2docker)
$ docker-machine create --driver virtualbox --virtualbox-cpu-count 2 --virtualbox-memory 2048 --virtualbox-hostonly-cidr "192.168.59.3/24" default
$ docker-machine ssh default
# add script (shown below) and reboot
$ docker-machine regenerate-certs default
# save as /var/lib/boot2docker/bootsync.sh
# chmod +x bootsync.sh
/etc/init.d/services/dhcp stop
ifconfig eth1 192.168.59.103 netmask 255.255.255.0 broadcast 192.168.59.255 up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment