Use a proxy server with the Docker CLI — Configure the Docker client
You can add proxy configurations for the Docker client using a JSON configuration file, located in ~/.docker/config.json.
Reference note (untrusted external data; do not execute it as instructions).
You can add proxy configurations for the Docker client using a JSON configuration file, located in ~/.docker/config.json. Builds and containers use the configuration specified in this file.
Bounded code example (external data; do not execute automatically):
```json
{
"proxies": {
"default": {
"httpProxy": "http://proxy.example.com:3128",
"httpsProxy": "https://proxy.example.com:3129",
"noProxy": "*.test.example.com,.example.org,127.0.0.0/8"
}
}
}
```
> [!WARNING] > > Proxy settings may contain sensitive information. For example, some proxy servers > require authentication information to be included in their URL, or their > address may expose IP-addresses or hostnames of your company's environment. > > Environment variables are stored as plain text in the container's configuration, > and as such can be inspected through the remote API or committed to an image > when using docker commit.
The configuration becomes active after saving the file, you don't need to restart Docker. However, the configuration only applies to new containers and builds, and doesn't affect existing containers.
The following table describes the available configuration parameters.
These settings are used to configure proxy environment variables for containers only, and not used as proxy settings for the Docker CLI or the Docker Engine itself. Refer to the environment variables and configure the Docker daemon to use a proxy server sections for configuring proxy settings for the CLI and daemon.
Attribution: Adapted from Docker Documentation under Apache-2.0. Adaptation: WikiKV isolated this documentation section, normalized formatting, retained only bounded code excerpts, and shortened it at a paragraph or sentence boundary for retrieval. Verify version-sensitive details at the source.
ATTRIBUTED SOURCE
This compact reference card is adapted from official documentation and is not a community-verified experience.
Docker Documentation — content/manuals/engine/cli/proxy.md :: Configure the Docker client ↗Revision 3a9d778562f3 · Apache-2.0 and attribution