I have a couple docker containers running on my local machine (pgadmin, jupyter notebooks etc) and have them mapped to various ports. I can happily navigate to localhost:10100 to get to the pgadmin web interface, for example. The issue is that when I connect to the work VPN I am unable to get to any locally running containers. I get an "ERR_CONNECTION_RESET" error on chrome.
With the VPN on I’ve tried:
- localhost:10100 (also tried 127.0.0.1)
- my-hostname:10100
- 192.168.0.X:10100 (the wifi interface address)
- 192.168.19.X:10100 (the VPN TUN interface address)
I can ping any of the above addresses and get a response and can successfully use them when the VPN is disabled. Using PulseVPN, Ubuntu 21.10, and fairly recent docker/docker-compose if that helps.
2
Answers
Turns out that are a combination of issues that are causing problems. I haven't found a bullet proof solution yet but here are some breadcrumbs for someone else:
My guess is that I have to fiddle with my network routing so that the docker networks are separated from the work VPN. It's been a decade since my CCNA so I can't remember how to do this off hand...
You can try to run the containers with the host network by adding the flag:
to the end of each command when you first start the containers.
And if that does not work, you can try it with: