docker / machine

Machine management for a container-centric world
https://docs.docker.com/machine/
Apache License 2.0
6.63k stars 1.97k forks source link

Docker machine does not re-bind network on change of ip #3011

Open gaffo opened 8 years ago

gaffo commented 8 years ago

When I'm workign on my laptop I'm often changing wifi networks because I'm working on multiple customer vpns. Every time I bind to a new network I get a new IP. Every time I bind to a new vpn I generally get a new IP. Because docker-machine uses tls and apparently binds it to the current ip address these certs are invalid when I change networks. This requires me to restart the docker machine pretty much every time I change networks just so I can communicate with it. My current option is disabling tls. I'd rather not do that.

This is on virtualbox.

lox commented 8 years ago

This shouldn't be happening as the network interface is NAT, which means that internally it should provide the same IP range. What is probable is that DNS settings are changing per network. Try creating your machine with --virtualbox-host-dns-resolver, which will use your hosts dns resolver via a proxy rather than passing down upstream DNS whenever DHCP provides it.

nathanleclaire commented 8 years ago

Does the problem persist with 0.7.0? We changed around the VirtualBox defaults a bit.