码头工人的daemon.json在哪里? (失踪) [英] Where's docker's daemon.json? (missing)

查看:1378
本文介绍了码头工人的daemon.json在哪里? (失踪)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

来自文档


Linux上配置文件的默认位置为
/etc/docker/daemon.json

The default location of the configuration file on Linux is /etc/docker/daemon.json

但是我没有在新的Docker安装中安装它:

But I don't have it on my fresh docker installation:

# docker --version
Docker version 17.03.1-ce, build c6d412e
# ls -la /etc/docker/
total 12
drwx------  2 root root 4096 Apr 28 17:58 .
drwxr-xr-x 96 root root 4096 Apr 28 17:58 ..
-rw-------  1 root root  244 Apr 28 17:58 key.json
# lsb_release -cs
trusty


推荐答案

默认配置如您所说,Linux上的文件路径为 /etc/docker/daemon.json ,但默认情况下不存在。您可以自己编写一个,然后在其中放置其他docker daemon配置内容,而不用将这些配置选项传递到命令行中。您甚至不必执行 dockerd --config-file /etc/docker/daemon.json ,因为这是默认路径,但是将其明确显示可能会很有用。

The default config file path on Linux is /etc/docker/daemon.json like you said, but it doesn't exist by default. You can write one yourself and put additional docker daemon configuration stuff in there instead of passing in those configuration options into the command line. You don't even have to do dockerd --config-file /etc/docker/daemon.json since that's the default path, but it can be useful to make it explicit for others who are inspecting the system.

还请确保您在 /etc/docker/daemon.json 与传递给 dockerd 的命令行调用中的选项没有冲突。供参考:

Also ensure that any configuration you set in /etc/docker/daemon.json doesn't conflict with options passed into the command line evocation of dockerd. For reference:


配置文件中设置的选项不得与通过标志设置的选项冲突。如果在文件和标志之间复制了一个选项,则不管其值如何,docker守护程序都无法启动。

The options set in the configuration file must not conflict with options set via flags. The docker daemon fails to start if an option is duplicated between the file and the flags, regardless their value.

这篇关于码头工人的daemon.json在哪里? (失踪)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆