问题描述
我正在尝试在适用于Windows的Docker桌面上更改 daemon.json
(已安装Windows 10 Aniversary最新更新) 1.13.0-rc5
,这样我就可以像这样更改"hosts":[]
设置:
I'm trying to change daemon.json
on Docker Desktop for Windows (Windows 10 Aniversary latest updates installed) 1.13.0-rc5
so I can change the "hosts": []
setting like this:
{
"hosts": [
"tcp://0.0.0.0",
"http://0.0.0.0"
]
}
但是,在使用设置应用程序更改设置后,出现此错误:
However, after change the settings using the settings app I got this error:
看起来该守护进程已经使用 -H
标志启动,并且json配置未与其合并.
Looks like the daemon is already started with -H
flag and the json config isn't merged with it.
那么,我们如何通过json文件更改这些设置或更改dockerd启动参数?
So, how can we change those settings by either json file or change the dockerd startup parameters?
推荐答案
您有一个与 issue 22339 :
或添加docker.conf
Or add in docker.conf
[Service]
ExecStart=
ExecStart=/path/to/dockerd
# or
ExecStart=/path/to/dockerd daemon
但是官方立场仍然是:
如果同时提供了 daemon.json
中的标志和选项,则会产生错误,这是实现该设计的决定(通常,标志应始终优先于配置文件);自动合并选项不是一个选项,因为这会导致意外的结果(是要覆盖一个选项还是要添加到一个选项?)
Producing an error if both a flag and an option in daemon.json
are provided was a design decision when implementing that (in general, flags should always have precedence over configuration files); automatically merging options was not an option, as this would lead to unexpected results (was the intent to override an option, or to add to an option?)
这篇关于更改“主机"/"-h"daemon.json中用于Windows的Docker的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!