desktop proxies: clarify situation on Mac and Windows (#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>
This commit is contained in:
David Scott 2022-07-08 12:12:39 +01:00 committed by GitHub
parent f34af64ece
commit c65a883cfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 34 deletions

View File

@ -127,29 +127,28 @@ File share settings are:
#### Proxies
Docker Desktop detects HTTP/HTTPS Proxy Settings from macOS and automatically
propagates these to Docker. For example, if you set your
proxy settings to `http://proxy.example.com`, Docker uses this proxy when
pulling containers.
HTTP/HTTPS proxies can be used when:
If you want to configure proxies manually, turn on the **Manual proxy configuration** setting.
- Logging in to Docker
- Pulling or pushing images
- Fetching artifacts during image builds
- Containers interact with the external network
- Scanning images
Your proxy settings, however, will not be propagated into the containers you start.
If you wish to set the proxy settings for your containers, you need to define
environment variables for them, just like you would do on Linux, for example:
Each use case above is configured slightly differently.
```console
$ docker run -e HTTP_PROXY=http://proxy.example.com:3128 alpine env
If the host uses a static HTTP/HTTPS proxy configuration, Docker Desktop reads this configuration
and automatically uses these settings for logging into Docker and for pulling and pushing images.
If the host uses a more sophisticated HTTP/HTTPS configuration, enable **Manual proxy configuration**
in the **Settings > Resources > Proxies** in Docker Dashboard and enter a single upstream proxy URL
of the form `http://username:password@proxy:port`.
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=b7edf988b2b5
TERM=xterm
HOME=/root
HTTP_PROXY=http://proxy.example.com:3128
```
HTTP/HTTPS traffic from image builds and running containers is forwarded transparently to the same
upstream proxy used for logging in and image pulls.
If you want to override this behaviour and use different HTTP/HTTPS proxies for image builds and
running containers, see [Configure the Docker client](/network/proxy#configure-the-docker-client).
For more information on setting environment variables for running containers,
see [Set environment variables](/engine/reference/commandline/run/#set-environment-variables--e---env---env-file).
The HTTPS proxy settings used for scanning images are set using the `HTTPS_PROXY` environment variable.
#### Network

View File

@ -142,26 +142,27 @@ containers. Alternatively, you can opt not to share it by selecting **Cancel**.
#### Proxies
Docker Desktop detects the HTTP/HTTPS proxy settings and
automatically propagates these to Docker. For example, if you set your proxy
settings to `http://proxy.example.com`, Docker uses this proxy when pulling containers.
Your proxy settings, however, will not be propagated into the containers you start.
If you wish to set the proxy settings for your containers, you need to define
environment variables for them, just like you would do on Linux, for example:
HTTP/HTTPS proxies can be used when
```ps
> docker run -e HTTP_PROXY=http://proxy.example.com:3128 alpine env
- Logging in to Docker
- Pulling or pushing images
- Fetching artifacts during image builds
- Containers interact with the external network
- Scanning images.
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=b7edf988b2b5
TERM=xterm
HOME=/root
HTTP_PROXY=http://proxy.example.com:3128
```
These are configured slightly differently.
For more information on setting environment variables for running containers,
see [Set environment variables](/engine/reference/commandline/run/#set-environment-variables--e---env---env-file).
If the host uses a static HTTP/HTTPS proxy configuration, Docker Desktop reads this configuration
and automatically uses these settings for logging into Docker and for pulling and pushing images.
If the host uses a more sophisticated HTTP/HTTPS configuration, enable **Manual proxy configuration**
in the **Settings** > **Resources** **Proxies** in the Docker Dashboard and enter a single upstream proxy URL
of the form `http://username:password@proxy:port`.
The HTTP/HTTPS proxy settings used for fetching artifacts during builds and for running containers
are set via the `.docker/config.json` file, see [Configure the Docker client](/network/proxy#configure-the-docker-client).
The HTTPS proxy settings used for scanning images are set using the `HTTPS_PROXY` environment variable.
#### Network