Prefer daemon.json over command-line flag

Using a daemon configuration file is preferred over
using command-line flags, as it allows reloading
this configuration without restarting the
daemon.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2017-10-27 21:56:04 +02:00 committed by Misty Stanley-Jones
parent e25f858bb6
commit d549a5cc37

View file

@ -92,8 +92,8 @@ proxy:
### Configure the Docker daemon
Either pass the `--registry-mirror` option when starting `dockerd` manually,
or edit `/etc/docker/daemon.json` and add the `registry-mirrors` key and value,
to make the change persistent.
or edit [`/etc/docker/daemon.json`](/engine/reference/commandline/dockerd.md#daemon-configuration-file)
and add the `registry-mirrors` key and value, to make the change persistent.
```json
{
@ -101,7 +101,7 @@ to make the change persistent.
}
```
Save the file and restart Docker for the change to take effect.
Save the file and reload Docker for the change to take effect.
> Some log messages that appear to be errors are actually informational messages.
>
@ -110,7 +110,7 @@ Save the file and restart Docker for the change to take effect.
> For example, this log message is informational:
>
> ```conf
> `time="2017-06-02T15:47:37Z" level=info msg="error statting local store, serving from upstream: unknown blob" go.version=go1.7.4`
> time="2017-06-02T15:47:37Z" level=info msg="error statting local store, serving from upstream: unknown blob" go.version=go1.7.4
> ```
>
> It's telling you that the file doesn't exist yet in the local cache and is
@ -128,16 +128,9 @@ command, for example:
$ docker pull registry.docker-cn.com/library/ubuntu
```
You can configure the Docker daemon with the `--registry-mirror` startup
parameter:
```bash
$ dockerd --registry-mirror=https://registry.docker-cn.com
```
Or you can add "https://registry.docker-cn.com" to the `registry-mirrors`
array in `/etc/docker/daemon.json` to pull from the China registry mirror
by default.
You can add `"https://registry.docker-cn.com"` to the `registry-mirrors` array
in [`/etc/docker/daemon.json`](/engine/reference/commandline/dockerd.md#daemon-configuration-file)
to pull from the China registry mirror by default.
```json
{
@ -145,4 +138,12 @@ by default.
}
```
Save the file and restart Docker for the change to take effect.
Save the file and reload Docker for the change to take effect.
Or, you can configure the Docker daemon with the `--registry-mirror` startup
parameter:
```bash
$ dockerd --registry-mirror=https://registry.docker-cn.com
```