forked from TrueCloudLab/distribution
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:
parent
e25f858bb6
commit
d549a5cc37
1 changed files with 16 additions and 15 deletions
|
@ -92,8 +92,8 @@ proxy:
|
||||||
### Configure the Docker daemon
|
### Configure the Docker daemon
|
||||||
|
|
||||||
Either pass the `--registry-mirror` option when starting `dockerd` manually,
|
Either pass the `--registry-mirror` option when starting `dockerd` manually,
|
||||||
or edit `/etc/docker/daemon.json` and add the `registry-mirrors` key and value,
|
or edit [`/etc/docker/daemon.json`](/engine/reference/commandline/dockerd.md#daemon-configuration-file)
|
||||||
to make the change persistent.
|
and add the `registry-mirrors` key and value, to make the change persistent.
|
||||||
|
|
||||||
```json
|
```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.
|
> 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:
|
> For example, this log message is informational:
|
||||||
>
|
>
|
||||||
> ```conf
|
> ```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
|
> 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
|
$ docker pull registry.docker-cn.com/library/ubuntu
|
||||||
```
|
```
|
||||||
|
|
||||||
You can configure the Docker daemon with the `--registry-mirror` startup
|
You can add `"https://registry.docker-cn.com"` to the `registry-mirrors` array
|
||||||
parameter:
|
in [`/etc/docker/daemon.json`](/engine/reference/commandline/dockerd.md#daemon-configuration-file)
|
||||||
|
to pull from the China registry mirror by default.
|
||||||
```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.
|
|
||||||
|
|
||||||
```json
|
```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
|
||||||
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue