adnichols / kitchen-docker-api

Docker driver for test-kitchen using a ruby based docker client
Other
11 stars 2 forks source link

kitchen-docker-api & proxy support #7

Closed ghost closed 8 years ago

ghost commented 8 years ago

I cannot seem to use kitchen-docker-api behind a proxy. Any assistance?

adnichols commented 8 years ago

What kind of proxy? for a SOCKS proxy you should use something like proxifier to proxy generic tcp ports for access to the docker API port & then you would point your DOCKER_HOST to the host:port of the socks proxy. Not sure what you are trying to do that isn't working.

ghost commented 8 years ago

I am using test-kitchen with kitchen-docker-api behind a corporate proxy. I am able to set proxy variables in my host environment which enables me to download a docker container from behind the proxy. However when the container is built for test-kitchen purposes, it does inject my proxy environment variables inside of the container so that apt-get and yum commands fail from within the container. Hopefully this makes better sense ....

adnichols commented 8 years ago

That does make sense. I never got around to implementing the http(s)_proxy configuration options but you could achieve the same result w/ a custom Dockerfile which sets env vars for http_proxy as is done here: https://github.com/portertech/kitchen-docker/pull/176/files

You can do this using the dockerfile option https://github.com/adnichols/kitchen-docker-api#dockerfile

I don't use this driver at the moment to test it but if you want to pass along a PR to do basically what's been done in kitchen-docker I can get it merged.

ghost commented 8 years ago

i went ahead and submitted: https://github.com/portertech/kitchen-docker/pull/176

If that gets accepted, I will attempt to make a similar PR request for this repo. Thanks @adnichols

ghost commented 8 years ago

I should have read that closer but that was my PR :smiley: @adnichols

ghost commented 8 years ago

https://github.com/adnichols/kitchen-docker-api/pull/8

here ya go :smiley: