Skip to content

Commit

Permalink
docs: update some examples for proxy configuration
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastiaan van Stijn <[email protected]>
  • Loading branch information
thaJeztah committed May 1, 2021
1 parent 759007c commit 68284ff
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
7 changes: 4 additions & 3 deletions docs/reference/builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -1974,10 +1974,11 @@ corresponding `ARG` instruction in the Dockerfile.
- `NO_PROXY`
- `no_proxy`

To use these, simply pass them on the command line using the flag:
To use these, pass them on the command line using the `--build-arg` flag, for
example:

```bash
--build-arg <varname>=<value>
```console
$ docker build --build-arg HTTPS_PROXY=https://my-proxy.example.com .
```

By default, these pre-defined variables are excluded from the output of
Expand Down
16 changes: 9 additions & 7 deletions docs/reference/commandline/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,12 @@ be set for each environment:
* `ftpProxy` (sets the value of `FTP_PROXY` and `ftp_proxy`)
* `noProxy` (sets the value of `NO_PROXY` and `no_proxy`)

> **Warning**: Proxy settings may contain sensitive information (for example,
> if the proxy requires authentication). 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`.
> **Warning**
>
> Proxy settings may contain sensitive information (for example, if the proxy
> requires authentication). 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`.
Once attached to a container, users detach from it and leave it running using
the using `CTRL-p CTRL-q` key sequence. This detach key sequence is customizable
Expand Down Expand Up @@ -301,13 +303,13 @@ Following is a sample `config.json` file:
"proxies": {
"default": {
"httpProxy": "http://user:[email protected]:3128",
"httpsProxy": "http://user:pass@example.com:3128",
"noProxy": "http://user:pass@example.com:3128",
"httpsProxy": "https://my-proxy.example.com:3129",
"noProxy": "intra.mycorp.example.com",
"ftpProxy": "http://user:[email protected]:3128"
},
"https://manager1.mycorp.example.com:2377": {
"httpProxy": "http://user:[email protected]:3128",
"httpsProxy": "http://user:pass@example.com:3128"
"httpsProxy": "https://my-proxy.example.com:3129"
},
}
}
Expand Down
8 changes: 6 additions & 2 deletions man/Dockerfile.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,12 @@ A Dockerfile is similar to a Makefile.
* `NO_PROXY`
* `no_proxy`

To use these, simply pass them on the command line using the `--build-arg
<varname>=<value>` flag.
To use these, pass them on the command line using `--build-arg` flag, for
example:

```
$ docker build --build-arg HTTPS_PROXY=https://my-proxy.example.com .
```

**ONBUILD**
-- `ONBUILD [INSTRUCTION]`
Expand Down

0 comments on commit 68284ff

Please sign in to comment.