Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build docker behind VPN

At the project I am at now, we have Github Enterprise set up behind a VPN, so I use OpenVPN to connect with my desktop (Ubuntu 14.04 LTS), but when I try to build with Docker (using Centos6) I always get ssh: Could not resolve hostname github.xxx.xxx: Name or service not known.

I've looked at the Docker documentation, but it looks that it is only solving problem using Proxy or a Bridge, and Google only returns answers on how I can set up OpenVPN on a Docker image.

So then I turn to Stackoverflow and hope for an answer on how I can run sudo docker build image and get it to use my VPN to clone from Github.

Also, our Mac users have installed Boot2Docker, and have no problems building the image.

like image 957
Kyrremann Avatar asked Mar 17 '15 12:03

Kyrremann


People also ask

Does Docker work with VPN?

Docker Desktop networking can work when attached to a VPN. To do this, Docker Desktop intercepts traffic from the containers and injects it into the host as if it originated from the Docker application.

What is a docker bridge network?

In terms of Docker, a bridge network uses a software bridge which allows containers connected to the same bridge network to communicate, while providing isolation from containers which are not connected to that bridge network.

How is a docker container different from a VM?

Virtual machines have a host operating system and a guest operating system inside each VM. The guest OS can be any OS, such as Linux or Windows, irrespective of the host OS. In contrast, Docker containers are hosted on a single physical server with the host OS shared among them.


1 Answers

I tried all kinds of things, in the end the simplest thins helped on Ubuntu 18.04. Stoping and starting docker deamon.

Prerequisites: VPN off

sudo systemctl stop docker

---> Start VPN

sudo systemctl start docker

Hope will help someone.

like image 198
user3547202 Avatar answered Oct 11 '22 04:10

user3547202