设置多个DOCKER_OPTS参数

时间:2016-03-11 15:10:29

标签: docker

如果你想在Ubuntu上启动时将一个选项传递给Docker引擎,你可以编辑/etc/defaults/docker文件。

我将存储驱动程序设置为AUFS

DOCKER_OPTS="--storage-driver=aufs"

但是,如果我传递多个参数,Docker就不会启动。例如:

DOCKER_OPTS="--insecure-registry=0.0.0.0:5000 --storage-driver=aufs"

现在Docker无法启动:

# service docker stop && service docker start
docker start/running, process 31569
# service docker status
docker stop/waiting

来自/var/log/syslog

Mar 11 14:55:30 myhost kernel: [ 2788.030270] init: docker main process (31253) terminated with status 1
Mar 11 14:55:30 myhost kernel: [ 2788.030279] init: docker main process ended, respawning
Mar 11 14:55:30 myhost kernel: [ 2788.085931] init: docker main process (31287) terminated with status 1
Mar 11 14:55:30 myhost kernel: [ 2788.085940] init: docker respawning too fast, stopped

每个参数都可以自行运行,但如果一起传递,Docker服务就会拒绝启动。我在Docker version 1.10.3, build 20f81dd上使用Ubuntu 14.04 3.13.0-74-generic

如何将多个参数传递给DOCKER_OPTS

1 个答案:

答案 0 :(得分:0)

参数必须用,

分隔

此格式有效:

DOCKER_OPTS="--insecure-registry=0.0.0.0:5000,--storage-driver=aufs"