dhyve icon indicating copy to clipboard operation
dhyve copied to clipboard

Add support to let dhyve run behind a http proxy

Open fkoehler opened this issue 9 years ago • 7 comments

In our company my docker containers need to talk to http via a http proxy. Within boot2docker I was using the boot2docker profile and I exported the http_proxy env variable there.

I am not sure how to approach this actually with dhyve and there might be better solutions or existing workarounds.

Ideally I would like to add some env variables to the VM maybe when creating it or even have a dedicated option on dhave to add a http(s) proxy because it might be a quite general use case?

fkoehler avatar Sep 21 '15 13:09 fkoehler

I just realized I can add ~/.profile and add my http_proxy vars there. Would that solve my problem? I mean would docker then also use that if it tries to connect to the internet? Just can not verify it right now.

Would it still make sense to put some proxy option on dhyve init maybe and auto source that config ever y time?

fkoehler avatar Sep 21 '15 13:09 fkoehler

Ok, I just checked it and adding the http_proxy to ~/.profile does not help at all.

fkoehler avatar Sep 21 '15 13:09 fkoehler

Essentially we need something like:

https://github.com/boot2docker/boot2docker#docker-daemon-options

fkoehler avatar Sep 21 '15 13:09 fkoehler

Looking at https://github.com/nlf/dhyve-os/blob/master/rootfs/etc/default/docker I tried adding some "export http_proxy=...." to that inside my dhyve vm but it did not help either (after restarting the vm)

Any ideas for a workaround?

fkoehler avatar Sep 21 '15 15:09 fkoehler

i'll have to add support for this. good suggestion, though. i'll work on it

nlf avatar Sep 21 '15 17:09 nlf

Great, thanks! Is there a quick work around you have in your mind? i.e. shouldn't it work if I add the exports to the scripts which starts the docker daemon like https://github.com/nlf/dhyve-os/blob/master/rootfs/etc/init.d/S51docker

I tried it but it did not :(

fkoehler avatar Sep 22 '15 09:09 fkoehler

to add a proxy to docker, you can edit /etc/defaults/docker and pass it as a flag to the daemon directly

nlf avatar Jan 18 '16 17:01 nlf