From e246f1e4eec3290f343627e73a926b940b77b121 Mon Sep 17 00:00:00 2001 From: Tibor Vass Date: Wed, 22 Jul 2015 15:37:17 -0400 Subject: [PATCH] Update docs to use the new `docker daemon` command Signed-off-by: Tibor Vass --- docs/articles/basics.md | 4 +- docs/articles/configuring.md | 9 ++- docs/articles/https.md | 2 +- docs/articles/networking.md | 4 +- docs/articles/registry_mirror.md | 4 +- docs/articles/systemd.md | 2 +- docs/installation/binaries.md | 2 +- docs/installation/ubuntulinux.md | 2 +- docs/project/set-up-dev-env.md | 4 +- docs/project/test-and-docs.md | 2 +- docs/reference/api/docker_remote_api_v1.20.md | 2 +- docs/reference/commandline/cli.md | 3 + docs/reference/commandline/daemon.md | 59 +++++++++---------- docs/userguide/labels-custom-metadata.md | 2 +- 14 files changed, 50 insertions(+), 51 deletions(-) diff --git a/docs/articles/basics.md b/docs/articles/basics.md index 013ac1bc2a..62cff1de13 100644 --- a/docs/articles/basics.md +++ b/docs/articles/basics.md @@ -103,7 +103,7 @@ when no `-H` was passed in. Run Docker in daemon mode: - $ sudo /docker -H 0.0.0.0:5555 -d & + $ sudo /docker daemon -H 0.0.0.0:5555 & Download an `ubuntu` image: @@ -113,7 +113,7 @@ You can use multiple `-H`, for example, if you want to listen on both TCP and a Unix socket # Run docker in daemon mode - $ sudo /docker -H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock -d & + $ sudo /docker daemon -H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock & # Download an ubuntu image, use default Unix socket $ docker pull ubuntu # OR use the TCP port diff --git a/docs/articles/configuring.md b/docs/articles/configuring.md index 3321573d05..d7ae834d06 100644 --- a/docs/articles/configuring.md +++ b/docs/articles/configuring.md @@ -24,7 +24,7 @@ or `systemd` to manage the `docker` daemon's start and stop. The `docker` daemon can be run directly using the `-d` option. By default it listens on the Unix socket `unix:///var/run/docker.sock` - $ docker -d + $ docker daemon INFO[0000] +job init_networkdriver() INFO[0000] +job serveapi(unix:///var/run/docker.sock) @@ -34,10 +34,9 @@ the Unix socket `unix:///var/run/docker.sock` ### Configuring the docker daemon directly -If you're running the `docker` daemon directly by running `docker -d` instead +If you're running the `docker` daemon directly by running `docker daemon` instead of using a process manager, you can append the configuration options to the `docker` run -command directly. Just like the `-d` option, other options can be passed to the `docker` -daemon to configure it. +command directly. Other options can be passed to the `docker` daemon to configure it. Some of the daemon's options are: @@ -50,7 +49,7 @@ Some of the daemon's options are: Here is a an example of running the `docker` daemon with configuration options: - $ docker -d -D --tls=true --tlscert=/var/docker/server.pem --tlskey=/var/docker/serverkey.pem -H tcp://192.168.59.3:2376 + $ docker daemon -D --tls=true --tlscert=/var/docker/server.pem --tlskey=/var/docker/serverkey.pem -H tcp://192.168.59.3:2376 These options : diff --git a/docs/articles/https.md b/docs/articles/https.md index 7fe1d88c1b..2441629883 100644 --- a/docs/articles/https.md +++ b/docs/articles/https.md @@ -136,7 +136,7 @@ prevent accidental damage: Now you can make the Docker daemon only accept connections from clients providing a certificate trusted by our CA: - $ docker -d --tlsverify --tlscacert=ca.pem --tlscert=server-cert.pem --tlskey=server-key.pem \ + $ docker daemon --tlsverify --tlscacert=ca.pem --tlscert=server-cert.pem --tlskey=server-key.pem \ -H=0.0.0.0:2376 To be able to connect to Docker and validate its certificate, you now diff --git a/docs/articles/networking.md b/docs/articles/networking.md index d454dc1fd9..94b698a191 100644 --- a/docs/articles/networking.md +++ b/docs/articles/networking.md @@ -503,7 +503,7 @@ To assign globally routable IPv6 addresses to your containers you have to specify an IPv6 subnet to pick the addresses from. Set the IPv6 subnet via the `--fixed-cidr-v6` parameter when starting Docker daemon: - docker -d --ipv6 --fixed-cidr-v6="2001:db8:1::/64" + docker daemon --ipv6 --fixed-cidr-v6="2001:db8:1::/64" The subnet for Docker containers should at least have a size of `/80`. This way an IPv6 address can end with the container's MAC address and you prevent NDP @@ -589,7 +589,7 @@ Let's split up the configurable address range into two subnets `2001:db8::c000/125` and `2001:db8::c008/125`. The first one can be used by the host itself, the latter by Docker: - docker -d --ipv6 --fixed-cidr-v6 2001:db8::c008/125 + docker daemon --ipv6 --fixed-cidr-v6 2001:db8::c008/125 You notice the Docker subnet is within the subnet managed by your router that is connected to `eth0`. This means all devices (containers) with the addresses diff --git a/docs/articles/registry_mirror.md b/docs/articles/registry_mirror.md index 13461d5187..6e309824e2 100644 --- a/docs/articles/registry_mirror.md +++ b/docs/articles/registry_mirror.md @@ -36,11 +36,11 @@ There are two steps to set up and use a local registry mirror. You will need to pass the `--registry-mirror` option to your Docker daemon on startup: - docker --registry-mirror=http:// -d + docker daemon --registry-mirror=http:// For example, if your mirror is serving on `http://10.0.0.2:5000`, you would run: - docker --registry-mirror=http://10.0.0.2:5000 -d + docker daemon --registry-mirror=http://10.0.0.2:5000 **NOTE:** Depending on your local host setup, you may be able to add the diff --git a/docs/articles/systemd.md b/docs/articles/systemd.md index 919ad50daa..7082ca273f 100644 --- a/docs/articles/systemd.md +++ b/docs/articles/systemd.md @@ -70,7 +70,7 @@ In this example, we'll assume that your `docker.service` file looks something li [Service] Type=notify EnvironmentFile=-/etc/sysconfig/docker - ExecStart=/usr/bin/docker -d -H fd:// $OPTIONS + ExecStart=/usr/bin/docker daemon -H fd:// $OPTIONS LimitNOFILE=1048576 LimitNPROC=1048576 diff --git a/docs/installation/binaries.md b/docs/installation/binaries.md index 14bf7c2e74..ed02fb8a46 100644 --- a/docs/installation/binaries.md +++ b/docs/installation/binaries.md @@ -174,7 +174,7 @@ For example: ## Run the Docker daemon # start the docker in daemon mode from the directory you unpacked - $ sudo ./docker -d & + $ sudo ./docker daemon & ## Giving non-root access diff --git a/docs/installation/ubuntulinux.md b/docs/installation/ubuntulinux.md index 46cc65bced..7f2e1fa199 100644 --- a/docs/installation/ubuntulinux.md +++ b/docs/installation/ubuntulinux.md @@ -185,7 +185,7 @@ To create the `docker` group and add your user: If this fails with a message similar to this: - Cannot connect to the Docker daemon. Is 'docker -d' running on this host? + Cannot connect to the Docker daemon. Is 'docker daemon' running on this host? Check that the `DOCKER_HOST` environment variable is not set for your shell. If it is, unset it. diff --git a/docs/project/set-up-dev-env.md b/docs/project/set-up-dev-env.md index 06e6c01100..4e711f009e 100644 --- a/docs/project/set-up-dev-env.md +++ b/docs/project/set-up-dev-env.md @@ -285,7 +285,7 @@ with the `make.sh` script. 8. Start a `docker` daemon running inside your container. - root@5f8630b873fe:/go/src/github.com/docker/docker# docker -dD + root@5f8630b873fe:/go/src/github.com/docker/docker# docker daemon -D The `-dD` flag starts the daemon in debug mode. You'll find this useful when debugging your code. @@ -411,7 +411,7 @@ onto the `/go` directory inside the container. * copy the binary inside the development container using `cp bundles/1.5.0-dev/binary/docker /usr/bin` - * start `docker -dD` to launch the Docker daemon inside the container + * start `docker daemon -D` to launch the Docker daemon inside the container * run `docker ps` on local host to get the development container's name * connect to your running container `docker exec -it container_name bash` * use the `docker run hello-world` command to create and run a container diff --git a/docs/project/test-and-docs.md b/docs/project/test-and-docs.md index 7b0a59f322..e58ebd2967 100644 --- a/docs/project/test-and-docs.md +++ b/docs/project/test-and-docs.md @@ -120,7 +120,7 @@ Run the entire test suite on your current repository: PASS coverage: 70.8% of statements ---> Making bundle: test-docker-py (in bundles/1.5.0-dev/test-docker-py) - +++ exec docker --daemon --debug --host unix:///go/src/github.com/docker/docker/bundles/1.5.0-dev/test-docker-py/docker.sock --storage-driver vfs --exec-driver native --pidfile /go/src/github.com/docker/docker/bundles/1.5.0-dev/test-docker-py/docker.pid + +++ exec docker daemon --debug --host unix:///go/src/github.com/docker/docker/bundles/1.5.0-dev/test-docker-py/docker.sock --storage-driver vfs --exec-driver native --pidfile /go/src/github.com/docker/docker/bundles/1.5.0-dev/test-docker-py/docker.pid ................................................................. ---------------------------------------------------------------------- Ran 65 tests in 89.266s diff --git a/docs/reference/api/docker_remote_api_v1.20.md b/docs/reference/api/docker_remote_api_v1.20.md index 0076639c88..8524f31746 100644 --- a/docs/reference/api/docker_remote_api_v1.20.md +++ b/docs/reference/api/docker_remote_api_v1.20.md @@ -2269,4 +2269,4 @@ To set cross origin requests to the remote api please give values to `--api-cors-header` when running Docker in daemon mode. Set * (asterisk) allows all, default or blank means CORS disabled - $ docker -d -H="192.168.1.9:2375" --api-cors-header="http://foo.bar" + $ docker daemon -H="192.168.1.9:2375" --api-cors-header="http://foo.bar" diff --git a/docs/reference/commandline/cli.md b/docs/reference/commandline/cli.md index c6561cd365..0f8bfedaac 100644 --- a/docs/reference/commandline/cli.md +++ b/docs/reference/commandline/cli.md @@ -19,6 +19,9 @@ or execute `docker help`: $ docker Usage: docker [OPTIONS] COMMAND [arg...] + docker daemon [ --help | ... ] + docker [ -h | --help | -v | --version ] + -H, --host=[]: The socket(s) to bind to in daemon mode, specified using one or more tcp://host:port, unix:///path/to/socket, fd://* or fd://socketfd. A self-sufficient runtime for Linux containers. diff --git a/docs/reference/commandline/daemon.md b/docs/reference/commandline/daemon.md index eccc7fad7a..aec2a0776d 100644 --- a/docs/reference/commandline/daemon.md +++ b/docs/reference/commandline/daemon.md @@ -10,7 +10,7 @@ parent = "smn_cli" # daemon - Usage: docker [OPTIONS] COMMAND [arg...] + Usage: docker daemon [OPTIONS] A self-sufficient runtime for linux containers. @@ -18,9 +18,7 @@ parent = "smn_cli" --api-cors-header="" Set CORS headers in the remote API -b, --bridge="" Attach containers to a network bridge --bip="" Specify network bridge IP - --config=~/.docker Location of client config files -D, --debug=false Enable debug mode - -d, --daemon=false Enable daemon mode --default-gateway="" Container default gateway IPv4 address --default-gateway-v6="" Container default gateway IPv6 address --dns=[] DNS server to use @@ -58,15 +56,14 @@ parent = "smn_cli" --tlskey="~/.docker/key.pem" Path to TLS key file --tlsverify=false Use TLS and verify the remote --userland-proxy=true Use userland proxy for loopback traffic - -v, --version=false Print version information and quit Options with [] may be specified multiple times. The Docker daemon is the persistent process that manages containers. Docker uses the same binary for both the daemon and client. To run the daemon you -provide the `-d` flag. +type `docker daemon`. -To run the daemon with debug output, use `docker -d -D`. +To run the daemon with debug output, use `docker daemon -D`. ## Daemon socket option @@ -94,8 +91,8 @@ communication with the daemon. On Systemd based systems, you can communicate with the daemon via [Systemd socket activation](http://0pointer.de/blog/projects/socket-activation.html), -use `docker -d -H fd://`. Using `fd://` will work perfectly for most setups but -you can also specify individual sockets: `docker -d -H fd://3`. If the +use `docker daemon -H fd://`. Using `fd://` will work perfectly for most setups but +you can also specify individual sockets: `docker daemon -H fd://3`. If the specified socket activated files aren't found, then Docker will exit. You can find examples of using Systemd socket activation with Docker and Systemd in the [Docker source tree](https://github.com/docker/docker/tree/master/contrib/init/systemd/). @@ -104,7 +101,7 @@ You can configure the Docker daemon to listen to multiple sockets at the same time using multiple `-H` options: # listen using the default unix socket, and on 2 specific IP addresses on this host. - docker -d -H unix:///var/run/docker.sock -H tcp://192.168.59.106 -H tcp://10.10.10.2 + docker daemon -H unix:///var/run/docker.sock -H tcp://192.168.59.106 -H tcp://10.10.10.2 The Docker client will honor the `DOCKER_HOST` environment variable to set the `-H` flag for the client. @@ -152,16 +149,16 @@ article explains how to tune your existing setup without the use of options. The `btrfs` driver is very fast for `docker build` - but like `devicemapper` does not share executable memory between devices. Use -`docker -d -s btrfs -g /mnt/btrfs_partition`. +`docker daemon -s btrfs -g /mnt/btrfs_partition`. The `zfs` driver is probably not fast as `btrfs` but has a longer track record on stability. Thanks to `Single Copy ARC` shared blocks between clones will be -cached only once. Use `docker -d -s zfs`. To select a different zfs filesystem +cached only once. Use `docker daemon -s zfs`. To select a different zfs filesystem set `zfs.fsname` option as described in [Storage driver options](#storage-driver-options). The `overlay` is a very fast union filesystem. It is now merged in the main Linux kernel as of [3.18.0](https://lkml.org/lkml/2014/10/26/137). Call -`docker -d -s overlay` to use it. +`docker daemon -s overlay` to use it. > **Note:** > As promising as `overlay` is, the feature is still quite young and should not @@ -196,7 +193,7 @@ options for `zfs` start with `zfs`. Example use: - docker -d --storage-opt dm.thinpooldev=/dev/mapper/thin-pool + docker daemon --storage-opt dm.thinpooldev=/dev/mapper/thin-pool * `dm.basesize` @@ -216,7 +213,7 @@ options for `zfs` start with `zfs`. Example use: - $ docker -d --storage-opt dm.basesize=20G + $ docker daemon --storage-opt dm.basesize=20G * `dm.loopdatasize` @@ -229,7 +226,7 @@ options for `zfs` start with `zfs`. Example use: - $ docker -d --storage-opt dm.loopdatasize=200G + $ docker daemon --storage-opt dm.loopdatasize=200G * `dm.loopmetadatasize` @@ -242,7 +239,7 @@ options for `zfs` start with `zfs`. Example use: - $ docker -d --storage-opt dm.loopmetadatasize=4G + $ docker daemon --storage-opt dm.loopmetadatasize=4G * `dm.fs` @@ -251,7 +248,7 @@ options for `zfs` start with `zfs`. Example use: - $ docker -d --storage-opt dm.fs=xfs + $ docker daemon --storage-opt dm.fs=xfs * `dm.mkfsarg` @@ -259,7 +256,7 @@ options for `zfs` start with `zfs`. Example use: - $ docker -d --storage-opt "dm.mkfsarg=-O ^has_journal" + $ docker daemon --storage-opt "dm.mkfsarg=-O ^has_journal" * `dm.mountopt` @@ -267,7 +264,7 @@ options for `zfs` start with `zfs`. Example use: - $ docker -d --storage-opt dm.mountopt=nodiscard + $ docker daemon --storage-opt dm.mountopt=nodiscard * `dm.datadev` @@ -281,7 +278,7 @@ options for `zfs` start with `zfs`. Example use: - $ docker -d --storage-opt dm.datadev=/dev/sdb1 --storage-opt dm.metadatadev=/dev/sdc1 + $ docker daemon --storage-opt dm.datadev=/dev/sdb1 --storage-opt dm.metadatadev=/dev/sdc1 * `dm.metadatadev` @@ -299,7 +296,7 @@ options for `zfs` start with `zfs`. Example use: - $ docker -d --storage-opt dm.datadev=/dev/sdb1 --storage-opt dm.metadatadev=/dev/sdc1 + $ docker daemon --storage-opt dm.datadev=/dev/sdb1 --storage-opt dm.metadatadev=/dev/sdc1 * `dm.blocksize` @@ -308,7 +305,7 @@ options for `zfs` start with `zfs`. Example use: - $ docker -d --storage-opt dm.blocksize=512K + $ docker daemon --storage-opt dm.blocksize=512K * `dm.blkdiscard` @@ -322,7 +319,7 @@ options for `zfs` start with `zfs`. Example use: - $ docker -d --storage-opt dm.blkdiscard=false + $ docker daemon --storage-opt dm.blkdiscard=false * `dm.override_udev_sync_check` @@ -348,7 +345,7 @@ options for `zfs` start with `zfs`. To allow the `docker` daemon to start, regardless of `udev` sync not being supported, set `dm.override_udev_sync_check` to true: - $ docker -d --storage-opt dm.override_udev_sync_check=true + $ docker daemon --storage-opt dm.override_udev_sync_check=true When this value is `true`, the `devicemapper` continues and simply warns you the errors are happening. @@ -373,7 +370,7 @@ Currently supported options of `zfs`: Example use: - $ docker -d -s zfs --storage-opt zfs.fsname=zroot/docker + $ docker daemon -s zfs --storage-opt zfs.fsname=zroot/docker ## Docker execdriver option @@ -397,17 +394,17 @@ it is not available, the system uses `cgroupfs`. By default, if no option is specified, the execdriver first tries `systemd` and falls back to `cgroupfs`. This example sets the execdriver to `cgroupfs`: - $ sudo docker -d --exec-opt native.cgroupdriver=cgroupfs + $ sudo docker daemon --exec-opt native.cgroupdriver=cgroupfs Setting this option applies to all containers the daemon launches. ## Daemon DNS options To set the DNS server for all Docker containers, use -`docker -d --dns 8.8.8.8`. +`docker daemon --dns 8.8.8.8`. To set the DNS search domain for all Docker containers, use -`docker -d --dns-search example.com`. +`docker daemon --dns-search example.com`. ## Insecure registries @@ -456,7 +453,7 @@ need to be added to your Docker host's configuration: 1. Install the `ca-certificates` package for your distribution 2. Ask your network admin for the proxy's CA certificate and append them to `/etc/pki/tls/certs/ca-bundle.crt` -3. Then start your Docker daemon with `HTTPS_PROXY=http://username:password@proxy:port/ docker -d`. +3. Then start your Docker daemon with `HTTPS_PROXY=http://username:password@proxy:port/ docker daemon`. The `username:` and `password@` are optional - and are only needed if your proxy is set up to require authentication. @@ -486,9 +483,9 @@ Docker supports softlinks for the Docker data directory (`/var/lib/docker`) and for `/var/lib/docker/tmp`. The `DOCKER_TMPDIR` and the data directory can be set like this: - DOCKER_TMPDIR=/mnt/disk2/tmp /usr/local/bin/docker -d -D -g /var/lib/docker -H unix:// > /var/lib/boot2docker/docker.log 2>&1 + DOCKER_TMPDIR=/mnt/disk2/tmp /usr/local/bin/docker daemon -D -g /var/lib/docker -H unix:// > /var/lib/boot2docker/docker.log 2>&1 # or export DOCKER_TMPDIR=/mnt/disk2/tmp - /usr/local/bin/docker -d -D -g /var/lib/docker -H unix:// > /var/lib/boot2docker/docker.log 2>&1 + /usr/local/bin/docker daemon -D -g /var/lib/docker -H unix:// > /var/lib/boot2docker/docker.log 2>&1 diff --git a/docs/userguide/labels-custom-metadata.md b/docs/userguide/labels-custom-metadata.md index 693bfd55bd..2be7f8597f 100644 --- a/docs/userguide/labels-custom-metadata.md +++ b/docs/userguide/labels-custom-metadata.md @@ -164,7 +164,7 @@ List all images with `vendor` `ACME`: ## Daemon labels - docker -d \ + docker daemon \ --dns 8.8.8.8 \ --dns 8.8.4.4 \ -H unix:///var/run/docker.sock \