Dockerfile ADD does not use configured proxy

I’m on Mac OSX using Docker Desktop v4.35.1 with Docker Engine v27.3.1

I have an ADD directive in my Dockerfile that sources a corporate Git repository that’s located behind a proxy. I’m not able to resolve the Git remote host and my proxy logs indicate it’s not being used at all. I’ve tried the following using both localhost and host.docker.internal:

  • Set HTTP/S_PROXY as environment variables and as build arguments, as well as their lower-case counterparts
  • Set the Docker client proxy settings testing with localhost and host.docker.internal
  • Set the Docker daemon proxy settings

I’ve verified that my proxy is working and other build-type directives work, even resolving our internal corporate Docker registry. I’m at a complete loss at what to do, so any help would be greatly appreciated. Thanks!

I’m also unable to use a proxy for a build context, e.g. docker build -t image-tag git@internal-git.corp:org/repo.git.

I found the following issues that seem to talk about the issues:

IS this happening only with the ADD instruction or also with RUN?

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.