Docker: access to VPN domain from docker

There is some websource “” where I need to download some RPM package via wget. And this web-source is accessible only from VPN. So I’m using Cisco AnyConnect VPN client to enter VPN, then I want to build image using Dockerfile where this wget command is listed.

The problem is: Docker can’t access to that domain within container. So I tried to pass dns options in /etc/docker/daemon.json, but not sure what DNS IP I should pass, because in my local there are default DNS, I tried to pass in that array IP addresses of docker0 interface, e.g. — didn’t work.

  • Jenkins on Docker - Persist data
  • Merging dokku's version-controlled directories with docker's volumes
  • docker run -it bash -c 'Function from sourced file'
  • Jenkins Slave can't read settings.xml
  • udp traffic with Iperf for haproxy
  • Issues when starting docker build on windows
  • $ cat /etc/docker/daemon.json
       "insecure-registry": "",
       "dns": ["", "", ""]

    I also tried to add this websource to /etc/resolf.conf but when I run docker to build image — it’s edited to the prev state (changes are not persisted there), and I guess, it’s my Cisco VPN client behavior — didn’t work.

    Also tried to add IP address of interface created by Cisco VPN client to that dns — didn’t work

    I also commented out dns=dnsmasq in /etc/NetworkManager/NetworkManager.conf — didnt work

    For sure, I’m restarting docker and NetworkManager services after these changes.

    Question: Should I create some bridge between Docker container and my VPN? How to solve this issue?

  • docker-compose does not see volumes changes in docker-compose.yml
  • docker-machine cant connect to host/daemon and using insecure registry
  • How do I build docker images when my development environment mounts my codebase into the container?
  • Linking Containers via Docker Remote API
  • Docker Socket Without TLS
  • Python web application project structure and docker support
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.