Docker pull not using correct DNS server when private registry on VPN

For anyone else who hits this issue, you can workaround this by accessing the Docker VM directly and modifying the configuration inside the VM:

  1. Access the terminal of the Docker Alpine VM using GNU screen:
    $ screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty

  2. Login as user root. No password necessary

  3. Edit /etc/hosts and/or /etc/resolv.conf such that you can resolve your internal registry server from inside the Docker VM

  4. To quit the screen app, type CTRL-A, then CTRL-\

Note that these changes survive until Docker daemon is restarted. After which the steps will need to be performed again.