使用daemon.json文件丢失Docker 1.12证书

时间:2016-10-04 16:02:17

标签: docker configuration x509certificate

我在Ubuntu 16.04上运行docker 1.12,我需要更改bip选项,所以我创建了一个自定义/etc/docker/daemon.json配置文件,如下所示:

root@simo:/etc/docker# cat daemon.json 
{
    "authorization-plugins": [],
    "dns": ["8.8.8.8", "8.8.4.4"],
    "dns-opts": [],
    "dns-search": [],
    "exec-opts": [],
    "exec-root": "",
    "storage-driver": "",
    "storage-opts": [],
    "labels": [],
    "live-restore": true,
    "log-driver": "",
    "log-opts": {},
    "mtu": 0,
    "pidfile": "",
    "graph": "",
    "cluster-store": "",
    "cluster-store-opts": {},
    "cluster-advertise": "",
    "max-concurrent-downloads": 3,
    "max-concurrent-uploads": 5,
    "debug": true,
    "hosts": [],
    "log-level": "",
    "tls": false,
    "tlsverify": false,
    "tlscacert": "",
    "tlscert": "",
    "tlskey": "",
    "swarm-default-advertise-addr": "",
    "api-cors-header": "",
    "selinux-enabled": false,
    "userns-remap": "",
    "group": "",
    "cgroup-parent": "",
    "default-ulimits": {},
    "ipv6": false,
    "iptables": false,
    "ip-forward": false,
    "ip-masq": false,
    "userland-proxy": false,
    "ip": "0.0.0.0",
    "bridge": "",
    "bip": "172.17.42.1/16",
    "fixed-cidr": "",
    "fixed-cidr-v6": "",
    "default-gateway": "",
    "default-gateway-v6": "",
    "icc": false,
    "raw-logs": false,
    "registry-mirrors": [],
    "insecure-registries": [],
    "disable-legacy-registry": false,
    "default-runtime": "runc",
    "oom-score-adjust": -500
}

现在,如果我启动守护程序,它根本不起作用: FATA[0000] Could not load X509 key pair (cert: "", key: ""): open : no such file or directory

这绝对是正确的,但根本不允许我使用docker。

如果我删除了daemon.json文件,但是dockerd正确启动,所以我猜测,要么可以在不提供证书的情况下启动dockerd,要么我应该使用证书来运行dockerd。

如何使用daemon.json配置文件运行dockerd?

1 个答案:

答案 0 :(得分:0)

如果您只需要更改bip的值,那么关注daemon.json文件即可。

{
    "bip": "172.17.42.1/16"
}