docker/for-win

Using a proxy while building images

SebastianPfliegel opened this issue · 10 comments

Expected behavior

I need to use a proxy and I'm able to set it in the proxies tab in the Docker Settings. I expect Docker to use the set proxy for all kind of transactions: pulling/pushing images, in the final container and while building the actual image.

Actual behavior

Unfortunately this only applies to pulling/pushing images and the container. While building no proxy is set and therefore functions like apt-get and curl fail.

Information

  • Diagnostic ID: 80162FE0-1E80-4CAD-9437-195610F0B460/2017-12-04_15-43-59
  • Windows 10 Enterprise

Steps to reproduce the behavior

  1. set a proxy in the settings GUI and apply
  2. build a Dockerfile using RUN apt-get update
  3. build fails due to connection refused

Workaround

As a workaround I'm able to set the build args myself. Here's a sample compose-file:

version: '2'
services:
  my_service:
    image: myservice:latest
    build:
      context: .
      dockerfile: Dockerfile
      args:
        - http_proxy=http://myproxy.com:8080
        - https_proxy=http://myproxy.com:8080
        - HTTP_PROXY=http://myproxy.com:8080
        - HTTPS_PROXY=http://myproxy.com:8080

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30d of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle stale

/remove-lifecycle stale

I met same issue.
The workaround is work fine. Thanks! @SebastianPfliegel

Additionally, in my case, I found another solution.
I set proxy settings to ~/.docker/config.json . This issue was solved.
ref. https://docs.docker.com/network/proxy/

Environment

  • OS: Windows 10 Pro
  • Docker: Version 18.03.1-ce-win65 (17513)
  • Docker Compose: v1.21.1

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30d of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle stale

/remove-lifecycle stale

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30d of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle stale

/remove-lifecycle stale

So, apparently no-one cares :-)

I guess so

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30d of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle stale

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle locked