How to assign a docker-machine host a static ip address

Boot2docker uses DHCP by default. Most solutions I found simply assign a static address and neglect to disable DHCP. Which led to the machine simply changing its ip address after some time. This command line should take care of that: cat <<EOF | docker-machine ssh docker-host sudo tee /var/lib/boot2docker/bootsync.sh > /dev/null kill `more /var/run/udhcpc.eth0.pid` ifconfig…