Skip to content

Commit c65a883

Browse files
djs55usha-mandyaaevesdocker
authored
desktop proxies: clarify situation on Mac and Windows (docker#15045)
* desktop proxies: clarify situation on Mac and Windows 1. there are multiple different places proxies are configured (unfortunately) 2. there are behaviour differences between Mac and Windows (currently Mac performs transparent proxying but Windows does not) 3. rather than manually setting environment variables for containers we should use the CLI's new config.json support. Signed-off-by: David Scott <dave.scott@docker.com> * Apply suggestions from code review Co-authored-by: Allie Sadler <102604716+aevesdocker@users.noreply.github.com> * Update index.md * Update index.md Co-authored-by: Usha Mandya <47779042+usha-mandya@users.noreply.github.com> Co-authored-by: Allie Sadler <102604716+aevesdocker@users.noreply.github.com>
1 parent f34af64 commit c65a883

File tree

2 files changed

+37
-37
lines changed

2 files changed

+37
-37
lines changed

desktop/mac/index.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -127,29 +127,28 @@ File share settings are:
127127

128128
#### Proxies
129129

130-
Docker Desktop detects HTTP/HTTPS Proxy Settings from macOS and automatically
131-
propagates these to Docker. For example, if you set your
132-
proxy settings to `http://proxy.example.com`, Docker uses this proxy when
133-
pulling containers.
130+
HTTP/HTTPS proxies can be used when:
134131

135-
If you want to configure proxies manually, turn on the **Manual proxy configuration** setting.
132+
- Logging in to Docker
133+
- Pulling or pushing images
134+
- Fetching artifacts during image builds
135+
- Containers interact with the external network
136+
- Scanning images
136137

137-
Your proxy settings, however, will not be propagated into the containers you start.
138-
If you wish to set the proxy settings for your containers, you need to define
139-
environment variables for them, just like you would do on Linux, for example:
138+
Each use case above is configured slightly differently.
140139

141-
```console
142-
$ docker run -e HTTP_PROXY=http://proxy.example.com:3128 alpine env
140+
If the host uses a static HTTP/HTTPS proxy configuration, Docker Desktop reads this configuration
141+
and automatically uses these settings for logging into Docker and for pulling and pushing images.
142+
If the host uses a more sophisticated HTTP/HTTPS configuration, enable **Manual proxy configuration**
143+
in the **Settings > Resources > Proxies** in Docker Dashboard and enter a single upstream proxy URL
144+
of the form `http://username:password@proxy:port`.
143145

144-
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
145-
HOSTNAME=b7edf988b2b5
146-
TERM=xterm
147-
HOME=/root
148-
HTTP_PROXY=http://proxy.example.com:3128
149-
```
146+
HTTP/HTTPS traffic from image builds and running containers is forwarded transparently to the same
147+
upstream proxy used for logging in and image pulls.
148+
If you want to override this behaviour and use different HTTP/HTTPS proxies for image builds and
149+
running containers, see [Configure the Docker client](/network/proxy#configure-the-docker-client).
150150

151-
For more information on setting environment variables for running containers,
152-
see [Set environment variables](/engine/reference/commandline/run/#set-environment-variables--e---env---env-file).
151+
The HTTPS proxy settings used for scanning images are set using the `HTTPS_PROXY` environment variable.
153152

154153
#### Network
155154

desktop/windows/index.md

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -142,26 +142,27 @@ containers. Alternatively, you can opt not to share it by selecting **Cancel**.
142142

143143
#### Proxies
144144

145-
Docker Desktop detects the HTTP/HTTPS proxy settings and
146-
automatically propagates these to Docker. For example, if you set your proxy
147-
settings to `http://proxy.example.com`, Docker uses this proxy when pulling containers.
148-
149-
Your proxy settings, however, will not be propagated into the containers you start.
150-
If you wish to set the proxy settings for your containers, you need to define
151-
environment variables for them, just like you would do on Linux, for example:
152-
153-
```ps
154-
> docker run -e HTTP_PROXY=http://proxy.example.com:3128 alpine env
155-
156-
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
157-
HOSTNAME=b7edf988b2b5
158-
TERM=xterm
159-
HOME=/root
160-
HTTP_PROXY=http://proxy.example.com:3128
161-
```
162145

163-
For more information on setting environment variables for running containers,
164-
see [Set environment variables](/engine/reference/commandline/run/#set-environment-variables--e---env---env-file).
146+
HTTP/HTTPS proxies can be used when
147+
148+
- Logging in to Docker
149+
- Pulling or pushing images
150+
- Fetching artifacts during image builds
151+
- Containers interact with the external network
152+
- Scanning images.
153+
154+
These are configured slightly differently.
155+
156+
If the host uses a static HTTP/HTTPS proxy configuration, Docker Desktop reads this configuration
157+
and automatically uses these settings for logging into Docker and for pulling and pushing images.
158+
If the host uses a more sophisticated HTTP/HTTPS configuration, enable **Manual proxy configuration**
159+
in the **Settings** > **Resources** **Proxies** in the Docker Dashboard and enter a single upstream proxy URL
160+
of the form `http://username:password@proxy:port`.
161+
162+
The HTTP/HTTPS proxy settings used for fetching artifacts during builds and for running containers
163+
are set via the `.docker/config.json` file, see [Configure the Docker client](/network/proxy#configure-the-docker-client).
164+
165+
The HTTPS proxy settings used for scanning images are set using the `HTTPS_PROXY` environment variable.
165166

166167
#### Network
167168

0 commit comments

Comments
 (0)