Skip to content

Commit f480fb1

Browse files
authored
Merge pull request #4202 from thaJeztah/23.0_backport_docs_daemon_proxy_config
[23.0 backport] docs/reference: update dockerd docs for changes in 23.0
2 parents ad7ae5a + b6cd3c8 commit f480fb1

File tree

4 files changed

+82
-39
lines changed

4 files changed

+82
-39
lines changed

docs/reference/commandline/cli.md

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -123,30 +123,31 @@ the [installation](https://docs.docker.com/install/) instructions for your opera
123123
The following list of environment variables are supported by the `docker` command
124124
line:
125125

126-
| Variable | Description |
127-
|:------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------|
128-
| `DOCKER_API_VERSION` | Override the negotiated API version to use for debugging (e.g. `1.19`) |
129-
| `DOCKER_CERT_PATH` | Location of your authentication keys. This variable is used both by the `docker` CLI and the [`dockerd` daemon](dockerd.md) |
130-
| `DOCKER_CONFIG` | The location of your client configuration files. |
131-
| `DOCKER_CONTENT_TRUST_SERVER` | The URL of the Notary server to use. Defaults to the same URL as the registry. |
132-
| `DOCKER_CONTENT_TRUST` | When set Docker uses notary to sign and verify images. Equates to `--disable-content-trust=false` for build, create, pull, push, run. |
133-
| `DOCKER_CONTEXT` | Name of the `docker context` to use (overrides `DOCKER_HOST` env var and default context set with `docker context use`) |
134-
| `DOCKER_DEFAULT_PLATFORM` | Default platform for commands that take the `--platform` flag. |
135-
| `DOCKER_HIDE_LEGACY_COMMANDS` | When set, Docker hides "legacy" top-level commands (such as `docker rm`, and `docker pull`) in `docker help` output, and only `Management commands` per object-type (e.g., `docker container`) are printed. This may become the default in a future release, at which point this environment-variable is removed. |
136-
| `DOCKER_HOST` | Daemon socket to connect to. |
137-
| `DOCKER_TLS_VERIFY` | When set Docker uses TLS and verifies the remote. This variable is used both by the `docker` CLI and the [`dockerd` daemon](dockerd.md) |
138-
| `BUILDKIT_PROGRESS` | Set type of progress output (`auto`, `plain`, `tty`) when [building](build.md) with [BuildKit backend](https://docs.docker.com/build/buildkit/). Use plain to show container output (default `auto`). |
126+
| Variable | Description |
127+
|:------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
128+
| `DOCKER_API_VERSION` | Override the negotiated API version to use for debugging (e.g. `1.19`) |
129+
| `DOCKER_CERT_PATH` | Location of your authentication keys. This variable is used both by the `docker` CLI and the [`dockerd` daemon](dockerd.md) |
130+
| `DOCKER_CONFIG` | The location of your client configuration files. |
131+
| `DOCKER_CONTENT_TRUST_SERVER` | The URL of the Notary server to use. Defaults to the same URL as the registry. |
132+
| `DOCKER_CONTENT_TRUST` | When set Docker uses notary to sign and verify images. Equates to `--disable-content-trust=false` for build, create, pull, push, run. |
133+
| `DOCKER_CONTEXT` | Name of the `docker context` to use (overrides `DOCKER_HOST` env var and default context set with `docker context use`) |
134+
| `DOCKER_DEFAULT_PLATFORM` | Default platform for commands that take the `--platform` flag. |
135+
| `DOCKER_HIDE_LEGACY_COMMANDS` | When set, Docker hides "legacy" top-level commands (such as `docker rm`, and `docker pull`) in `docker help` output, and only `Management commands` per object-type (e.g., `docker container`) are printed. This may become the default in a future release. |
136+
| `DOCKER_HOST` | Daemon socket to connect to. |
137+
| `DOCKER_TLS_VERIFY` | When set Docker uses TLS and verifies the remote. This variable is used both by the `docker` CLI and the [`dockerd` daemon](dockerd.md) |
138+
| `BUILDKIT_PROGRESS` | Set type of progress output (`auto`, `plain`, `tty`) when [building](build.md) with [BuildKit backend](https://docs.docker.com/build/buildkit/). Use plain to show container output (default `auto`). |
139139

140140
Because Docker is developed using Go, you can also use any environment
141141
variables used by the Go runtime. In particular, you may find these useful:
142142

143-
* `HTTP_PROXY`
144-
* `HTTPS_PROXY`
145-
* `NO_PROXY`
143+
| Variable | Description |
144+
|:--------------|:-------------------------------------------------------------------------------|
145+
| `HTTP_PROXY` | Proxy URL for HTTP requests unless overridden by NoProxy. |
146+
| `HTTPS_PROXY` | Proxy URL for HTTPS requests unless overridden by NoProxy. |
147+
| `NO_PROXY` | Comma-separated values specifying hosts that should be excluded from proxying. |
146148

147-
These Go environment variables are case-insensitive. See the
148-
[Go specification](https://golang.org/pkg/net/http/) for details on these
149-
variables.
149+
See the [Go specification](https://pkg.go.dev/golang.org/x/net/http/httpproxy#Config)
150+
for details on these variables.
150151

151152
## Configuration files
152153

docs/reference/commandline/dockerd.md

Lines changed: 48 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ redirect_from:
1818
# daemon
1919

2020
```markdown
21-
Usage: dockerd COMMAND
21+
Usage: dockerd [OPTIONS]
2222

2323
A self-sufficient runtime for containers.
2424

@@ -35,14 +35,14 @@ Options:
3535
--containerd-namespace string Containerd namespace to use (default "moby")
3636
--containerd-plugins-namespace string Containerd namespace to use for plugins (default "plugins.moby")
3737
--cpu-rt-period int Limit the CPU real-time period in microseconds for the
38-
parent cgroup for all containers
38+
parent cgroup for all containers (not supported with cgroups v2)
3939
--cpu-rt-runtime int Limit the CPU real-time runtime in microseconds for the
40-
parent cgroup for all containers
40+
parent cgroup for all containers (not supported with cgroups v2)
4141
--cri-containerd start containerd with cri
4242
--data-root string Root directory of persistent Docker state (default "/var/lib/docker")
4343
-D, --debug Enable debug mode
4444
--default-address-pool pool-options Default address pools for node specific local networks
45-
--default-cgroupns-mode string Default mode for containers cgroup namespace ("host" | "private") (default "host")
45+
--default-cgroupns-mode string Default mode for containers cgroup namespace ("host" | "private") (default "private")
4646
--default-gateway ip Container default gateway IPv4 address
4747
--default-gateway-v6 ip Container default gateway IPv6 address
4848
--default-ipc-mode string Default mode for containers ipc ("shareable" | "private") (default "private")
@@ -62,15 +62,17 @@ Options:
6262
-H, --host list Daemon socket(s) to connect to
6363
--host-gateway-ip ip IP address that the special 'host-gateway' string in --add-host resolves to.
6464
Defaults to the IP address of the default bridge
65+
--http-proxy string HTTP proxy URL to use for outgoing traffic
66+
--https-proxy string HTTPS proxy URL to use for outgoing traffic
6567
--icc Enable inter-container communication (default true)
6668
--init Run an init in the container to forward signals and reap processes
6769
--init-path string Path to the docker-init binary
6870
--insecure-registry list Enable insecure registry communication
6971
--ip ip Default IP when binding container ports (default 0.0.0.0)
7072
--ip-forward Enable net.ipv4.ip_forward (default true)
7173
--ip-masq Enable IP masquerading (default true)
74+
--ip6tables Enable addition of ip6tables rules (experimental)
7275
--iptables Enable addition of iptables rules (default true)
73-
--ip6tables Enable addition of ip6tables rules (default false)
7476
--ipv6 Enable IPv6 networking
7577
--label list Set key=value labels to the daemon
7678
--live-restore Enable live restore of docker when containers are still running
@@ -81,16 +83,17 @@ Options:
8183
--max-concurrent-uploads int Set the max concurrent uploads (default 5)
8284
--max-download-attempts int Set the max download attempts for each pull (default 5)
8385
--metrics-addr string Set default address and port to serve the metrics api on
84-
--mtu int Set the containers network MTU
86+
--mtu int Set the containers network MTU (default 1500)
8587
--network-control-plane-mtu int Network Control plane MTU (default 1500)
8688
--no-new-privileges Set no-new-privileges by default for new containers
89+
--no-proxy string Comma-separated list of hosts or IP addresses for which the proxy is skipped
8790
--node-generic-resource list Advertise user-defined resource
88-
--oom-score-adjust int Set the oom_score_adj for the daemon (default -500)
91+
--oom-score-adjust int Set the oom_score_adj for the daemon
8992
-p, --pidfile string Path to use for daemon PID file (default "/var/run/docker.pid")
9093
--raw-logs Full timestamps without ANSI coloring
9194
--registry-mirror list Preferred registry mirror
9295
--rootless Enable rootless mode; typically used with RootlessKit
93-
--seccomp-profile string Path to seccomp profile
96+
--seccomp-profile string Path to seccomp profile. Use "unconfined" to disable the default seccomp profile (default "builtin")
9497
--selinux-enabled Enable selinux support
9598
--shutdown-timeout int Set the default shutdown timeout (default 15)
9699
-s, --storage-driver string Storage driver to use
@@ -129,16 +132,42 @@ to [the `daemon.json` file](#daemon-configuration-file).
129132
For easy reference, the following list of environment variables are supported
130133
by the `dockerd` command line:
131134

132-
* `DOCKER_DRIVER` The graph driver to use.
133-
* `DOCKER_NOWARN_KERNEL_VERSION` Prevent warnings that your Linux kernel is
134-
unsuitable for Docker.
135-
* `DOCKER_RAMDISK` If set this will disable 'pivot_root'.
136-
* `DOCKER_TMPDIR` Location for temporary Docker files.
137-
* `MOBY_DISABLE_PIGZ` Do not use [`unpigz`](https://linux.die.net/man/1/pigz) to
138-
decompress layers in parallel when pulling images, even if it is installed.
135+
| Variable | Description |
136+
|:--------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
137+
| `DOCKER_CERT_PATH` | Location of your authentication keys. This variable is used both by the [`docker` CLI](cli.md) and the `dockerd` daemon. |
138+
| `DOCKER_DRIVER` | The storage driver to use. |
139+
| `DOCKER_RAMDISK` | If set this disables 'pivot_root'. |
140+
| `DOCKER_TLS_VERIFY` | When set Docker uses TLS and verifies the remote. This variable is used both by the [`docker` CLI](cli.md) and the `dockerd` daemon. |
141+
| `DOCKER_TMPDIR` | Location for temporary files created by the daemon. |
142+
| `HTTP_PROXY` | Proxy URL for HTTP requests unless overridden by NoProxy. See the [Go specification](https://pkg.go.dev/golang.org/x/net/http/httpproxy#Config) for details. |
143+
| `HTTPS_PROXY` | Proxy URL for HTTPS requests unless overridden by NoProxy. See the [Go specification](https://pkg.go.dev/golang.org/x/net/http/httpproxy#Config) for details. |
144+
| `MOBY_DISABLE_PIGZ` | Disables the use of [`unpigz`](https://linux.die.net/man/1/pigz) to decompress layers in parallel when pulling images, even if it is installed. | |
145+
| `NO_PROXY` | Comma-separated values specifying hosts that should be excluded from proxying. See the [Go specification](https://pkg.go.dev/golang.org/x/net/http/httpproxy#Config) for details. |
139146

140147
## Examples
141148

149+
### Proxy configuration
150+
151+
> **Note**
152+
>
153+
> Refer to the [Docker Desktop manual](https://docs.docker.com/desktop/networking/#httphttps-proxy-support)
154+
> if you are running [Docker Desktop](https://docs.docker.com/desktop/).
155+
156+
If you are behind an HTTP proxy server, for example in corporate settings,
157+
you may have to configure the Docker daemon to use the proxy server for
158+
operations such as pulling and pushing images. The daemon can be configured
159+
in three ways:
160+
161+
1. Using environment variables (`HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY`).
162+
2. Using the "http-proxy", "https-proxy", and "no-proxy" fields in the
163+
[daemon configuration file](#daemon-configuration-file) (Docker Engine 23.0 or newer).
164+
3. Using the `--http-proxy`, `--https-proxy`, and `--no-proxy` command-line
165+
options. (Docker Engine 23.0 or newer).
166+
167+
The command-line and configuration file options take precedence over environment
168+
variables. Refer to [control and configure Docker with systemd](https://docs.docker.com/config/daemon/systemd/#httphttps-proxy)
169+
to set these environment variables on a host using `systemd`.
170+
142171
### Daemon socket option
143172

144173
The Docker daemon can listen for [Docker Engine API](https://docs.docker.com/engine/api/)
@@ -1222,6 +1251,9 @@ This is a full example of the allowed configuration options on Linux:
12221251
"fixed-cidr-v6": "",
12231252
"group": "",
12241253
"hosts": [],
1254+
"http-proxy": "http://proxy.example.com:80",
1255+
"https-proxy": "https://proxy.example.com:443",
1256+
"no-proxy": "*.test.example.com,.example.org",
12251257
"icc": false,
12261258
"init": false,
12271259
"init-path": "/usr/libexec/docker-init",
@@ -1255,7 +1287,7 @@ This is a full example of the allowed configuration options on Linux:
12551287
"NVIDIA-GPU=UUID1",
12561288
"NVIDIA-GPU=UUID2"
12571289
],
1258-
"oom-score-adjust": -500,
1290+
"oom-score-adjust": 0,
12591291
"pidfile": "",
12601292
"raw-logs": false,
12611293
"registry-mirrors": [],

docs/reference/commandline/pull.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,8 @@ use `docker pull`.
3434

3535
If you are behind an HTTP proxy server, for example in corporate settings,
3636
before open a connect to registry, you may need to configure the Docker
37-
daemon's proxy settings, using the `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY`
38-
environment variables. To set these environment variables on a host using
39-
`systemd`, refer to the [control and configure Docker with systemd](https://docs.docker.com/config/daemon/systemd/#httphttps-proxy)
40-
for variables configuration.
37+
daemon's proxy settings, refer to the [dockerd command-line reference](dockerd.md#proxy-configuration)
38+
for details.
4139

4240
### Concurrent downloads
4341

man/dockerd.8.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ dockerd - Enable daemon mode
3535
[**-G**|**--group**[=*docker*]]
3636
[**-H**|**--host**[=*[]*]]
3737
[**--help**]
38+
[**--http-proxy**[*""*]]
39+
[**--https-proxy**[*""*]]
3840
[**--icc**[=*true*]]
3941
[**--init**[=*false*]]
4042
[**--init-path**[=*""*]]
@@ -54,6 +56,7 @@ dockerd - Enable daemon mode
5456
[**--max-concurrent-downloads**[=*3*]]
5557
[**--max-concurrent-uploads**[=*5*]]
5658
[**--max-download-attempts**[=*5*]]
59+
[**--no-proxy**[*""*]]
5760
[**--node-generic-resources**[=*[]*]]
5861
[**-p**|**--pidfile**[=*/var/run/docker.pid*]]
5962
[**--raw-logs**]
@@ -233,6 +236,12 @@ unix://[/path/to/socket] to use.
233236
**--help**
234237
Print usage statement
235238

239+
**--http-proxy***""*
240+
Proxy URL for HTTP requests unless overridden by NoProxy.
241+
242+
**--https-proxy***""*
243+
Proxy URL for HTTPS requests unless overridden by NoProxy.
244+
236245
**--icc**=*true*|*false*
237246
Allow unrestricted inter\-container and Docker daemon host communication. If
238247
disabled, containers can still be linked together using the **--link** option
@@ -325,6 +334,9 @@ unix://[/path/to/socket] to use.
325334
**--max-download-attempts**=*5*
326335
Set the max download attempts for each pull. Default is `5`.
327336

337+
**--no-proxy**=*""*"
338+
Comma-separated values specifying hosts that should be excluded from proxying.
339+
328340
**--node-generic-resources**=*[]*
329341
Advertise user-defined resource. Default is `[]`.
330342
Use this if your swarm cluster has some nodes with custom

0 commit comments

Comments
 (0)