I am running docker-machine on Windows 7 as part of the docker toolbox
When I run
> docker-machine env
SET DOCKER_TLS_VERIFY=1
SET DOCKER_HOST=tcp://192.168.99.100:2376
SET DOCKER_CERT_PATH=...\.docker\machine\machines\default
SET DOCKER_MACHINE_NAME=default
After configuring shell, I can interact with docker without any problem.
The problem arises when I connect to different network through VPN.
When I use
> tracert 192.168.99.100
I can see this IP is intercepted by VPN and that's the reason I get exception when running
> docker-machine env
Error checking TLS connection: Error checking and/or regenerating the certs: There was an error validating certificates for host "192.168.99.100:2376": dial tcp 192.168.99.100:2376: i/o timeout
Is there a way to change DOCKER_HOST as follows?
SET DOCKER_HOST=tcp://127.0.0.1:2376
Thanks for any help!
Start the docker quickstart terminal without connecting to VPN. then follow these steps:
suppose your machine name is default then the command would be : VBoxManage modifyvm “default” -–natpf1 “default,tcp,,2376,,2376”
Now connect to VPN. You are good to go. Docker will start working as usual as.
Another option is to create a new entry in the routing table that overrides the entry that the VPN software creates.
First, find the name of the VirtualBox Host-Only network interface
netsh int ip show ipaddresses
On my machine the interface is named "vbox2". Now, specify that all traffic to the docker machine at 192.168.99.100 should be sent through the "vbox2" interface.
netsh int ip add route 192.168.99.0/24 interface=vbox2 store=persistent
I prefer this method over the 127.0.0.1 solution because I don't have to forward any new ports with VBoxManage modifyvm.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With