VS Code Dev Containers: Proxy Settings for Builds and Runtime
remoteEnv covers VS Code subprocesses; runtime-wide environment, Dockerfile build inputs and base-image pulls belong to different owners.
Use the failed request's stage to choose the configuration source:
| Process | Proxy input to inspect |
|---|---|
| VS Code and related remote subprocesses | remoteEnv in devcontainer.json |
| Container-wide runtime | containerEnv for image/Dockerfile setup; service environment for Compose |
| Dockerfile RUN | Proxy build arguments, including Docker client proxy defaults |
| Base-image pull | Docker 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.