Docker: access to VPN domain from docker

There is some websource “http://vpnaccessible.com” 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 192.168.0.1, 8.8.8.8. I tried to pass in that array IP addresses of docker0 interface, e.g. 172.17.0.1 — didn’t work.

  • docker how do I know if an update was pulled from repository
  • docker license &vm replacement
  • ERRO : Error trying to connect to local peer: grpc: timed out trying to connect
  • How to push to AWS EC2 Service Container from a specific git branch (ie 'staging')
  • Running xterm in docker without X-server on host machine
  • Dockerize ASP Classic on IIS
  • $ cat /etc/docker/daemon.json
    {
       "insecure-registry": "http://my-insecure-registry.com",
       "dns": ["192.168.0.1", "172.17.0.1", "8.8.8.8"]
    }
    

    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?

  • How does one service resolve the address of another service using docker compose, link hostname, and ports?
  • How to remove all Docker containers
  • Why does :latest aspnet core docker image run when the tag :1.1 fails?
  • How to write PHP code to execute two functions
  • Why this is not working to share a data volume using Docker and MongoDB?
  • How to log docker build installation package errors
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.