I know that I can use boot2docker ip
or docker-machine ip
to get the assigned IP address of the boot2docker/docker-machine VM.
From what I understand the default IP addresses are:
Here are my questions related to this:
boot2docker
or docker-machine
on the same machine, can I rely on the VM always using the same IP address?I'm asking since I would like to store the environment variables created by boot2docker shellinit
or docker-machine env dev
in my user's profile, so I don't have to run these commands every time I start/stop the VM.
You definitely can not rely. I've been playing around a lot with docker-machine on local with virtualbox driver, and what I noticed is that the ip addresses assigned by docker-machine depend on the order of machine start. The first started machine gets .100 (even if before it was 119).