dhyve
dhyve copied to clipboard
Add support to let dhyve run behind a http proxy
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?
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?
Ok, I just checked it and adding the http_proxy to ~/.profile does not help at all.
Essentially we need something like:
https://github.com/boot2docker/boot2docker#docker-daemon-options
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?
i'll have to add support for this. good suggestion, though. i'll work on it
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 :(
to add a proxy to docker, you can edit /etc/defaults/docker
and pass it as a flag to the daemon directly