-
Notifications
You must be signed in to change notification settings - Fork 27
apt-get failures [HTTP proxy support] #14
Comments
Have you configured your Docker daemon with your corporate HTTP proxy addresses? |
Unfortunately yes with a proxy.conf and in the ENV variables. |
Can you confirm that your Docker daemon is configured properly like this:
|
Yes, Even confirmed by running: |
Does the following succeed?
Also, please provide the full output of:
with any sensitive info redacted. |
I am running into the same issue. When I run cflocal from behind a corporate proxy, the "apt" commands inside the docker container fail. This is because the proxy configuration also needs to be set inside the container and there does not seem to be a way to do this. Typically, you can pass environment variables as part of the "docker run" command. But cflocal hides the docker run command so there needs to be a different mechanism for setting the http_proxy, https_proxy, no_proxy environment variables inside the docker container created by cflocal. |
Can you describe your Docker setup? This seems to work for me, and I believe Docker for Mac/Windows uses a daemon called vpnkit that redirects all container HTTP traffic through an enterprise proxy without those env vars needing to be set. (FYI: CF Local doesn't actually use the docker CLI at all, it speaks directly to the Docker daemon. The Docker daemon usually handles setting these env vars in all containers if necessary.) |
Just to summarize, support for proxy is required in two places in docker.
I am running this inside a Ubuntu 16 VM. Proxy environment variables are set in bash shell. I have also set the proxy in /etc/systemd/system/docker.service.d/http-proxy.conf. This allows the cflinux2 and cflocal images to be downloaded. systemctl show --property=Environment docker If I create the docker container manually and run env inside, below is the output $ env UPDATE: |
I was under the impression that transparent proxying was more widely deployed than it actually is. Marking this as a bug. This will be easy to fix — expect it to work in the next release. |
Thanks, much appreciated. For completeness, I will add one other change that I needed to do in Docker to get everything working with a proxy and run "apt" commands successfully inside the docker container. By default, the DNS server information that is passed to the docker containers are the Google's free dns servers. These will likely know nothing about the corporate specific proxy servers and the container will fail to resolve the proxy server. Hence, the dns information passed to the containers needs to be overridden as well. I did this by setting DOCKER_OPTS environment variable similar to http_proxy variable. The format is |
@jlkweb12 @Shuchit Explicit support for HTTP and HTTPS proxies in containers should no longer be necessary in CF Local as of Docker 17.07. Please see here for instructions. I can confirm this works automatically on macOS (and it's documented to work automatically on macOS here). Please let me know if upgrading to Docker 17.07 addresses this issue for you. |
I tried this for a second time and I was not able to get it to work. I am on Ubuntu16 with docker running as a systemd service. I made sure I am using the latest release of docker 17.12.1-ce. The proxy configuration is passed in through systemd configuration and the docker deamon sees it as an environment variable. I did restart docker service to make sure the configuration is correctly picked up. It looks like docker daemon can pull down the required images using the proxy. But the container does not get passed the proxy information. |
Thanks for testing this out! Sorry that it's still not working. It occurs to me now that the logic to parse the |
@Shuchit can you try this release candidate for 0.19.0? It should respect any HTTP proxy settings in the environment that you're running CF Local in, as long as |
(In the official v0.19.0 release, the env var will likely be |
Fixed in v0.19.0. If you've customized |
I am getting an error executing this command:
/bin/sh -c apt-get update && apt-get -y install sshpass && apt-get clean
It appears to get through most of the second download progress bar and fail. I am behind a corporate proxy so that could be causing an issue.
do you have any ideas how to resolve this issue?
The text was updated successfully, but these errors were encountered: