# docker -h
Usage of docker:
-D=false: Enable debug mode
-H=[]: Multiple tcp://host:port or unix://path/to/socket to bind in daemon mode, single connection otherwise
-api-enable-cors=false: Enable CORS headers in the remote API
-b="": Attach containers to a pre-existing network bridge; use 'none' to disable container networking
-bip="": Use this CIDR notation address for the network bridge's IP, not compatible with -b
-d=false: Enable daemon mode
-dns=[]: Force docker to use specific DNS servers
-g="/var/lib/docker": Path to use as the root of the docker runtime
-icc=true: Enable inter-container communication
-ip="0.0.0.0": Default IP address to use when binding container ports
-iptables=true: Disable docker's addition of iptables rules
-p="/var/run/docker.pid": Path to use for daemon PID file
-r=true: Restart previously running containers
-s="": Force the docker runtime to use a specific storage driver
-v=false: Print version information and quit
#docker -d & 启动守护进程
注意有可能报如下错:
Error creating bridge: ip failed: ip link add docker0 type bridge (output: )
解决方法 (手工创建docker0网桥):
$ sudo ip link set dev docker0 down
$ sudo brctl delbr docker0
$ sudo iptables -t nat -F POSTROUTING
$ brctl addbr docker0
$ ip addr add 192.168.5.1/24 dev docker0
$ ip link set dev docker0 up
$ ip addr show docker0
$ echo 'DOCKER_OPTS="-b=docker0"' >> /etc/default/docker
$ docker -d &
Docker 的详细介绍 :请点这里