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.

  • How to set environment variables via env-file
  • Way to increase Boot2Docker volume size or alternative to install docker images locally
  • Terraform: Editing files with remote exec
  • How to keep a service running on a Docker container
  • Dockerfile: RUN command with special parameters
  • Docker :: Issue with Dockerfile - target folder not available
  • $ 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?

  • Lowercase images names in docker
  • How to write docker file to run a docker run command inside an image
  • Running `bash` using docker exec with xargs command
  • How can I link a Container Group with a Container?
  • Do Docker Linux Images Contain Kernels?
  • Mounting local volumes to remote docker container, Possible?
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.