Use the failed request's stage to choose the configuration source:

ProcessProxy input to inspect
VS Code and related remote subprocessesremoteEnv in devcontainer.json
Container-wide runtimecontainerEnv for image/Dockerfile setup; service environment for Compose
Dockerfile RUNProxy build arguments, including Docker client proxy defaults
Base-image pullDocker daemon outbound configuration

For the first row, merge a fragment such as:

"remoteEnv": {
  "HTTP_PROXY": "http://proxy.example:8080",
  "HTTPS_PROXY": "http://proxy.example:8080"
}

The downloader must support the variables; use lowercase names when required. For permitted public downloads, the HTTP proxy list supplies candidates for these remoteEnv URLs. Rebuild/reopen through the Dev Containers lifecycle after the change.

Runtime remoteEnv is too late for an earlier build or image pull. Avoid retaining personal proxy credentials in image layers with ENV.

The endpoint also needs container reachability. localhost means that container; a host proxy needs the address exposed by the chosen Docker platform and a reachable listener. Desktop's host.docker.internal is not a universal Linux interface.

Related articles