github.com/stchris/docker@v1.4.2-0.20150106053530-1510a324dbd5/docs/man/docker.1.md (about) 1 % DOCKER(1) Docker User Manuals 2 % William Henry 3 % APRIL 2014 4 # NAME 5 docker \- Docker image and container command line interface 6 7 # SYNOPSIS 8 **docker** [OPTIONS] COMMAND [arg...] 9 10 # DESCRIPTION 11 **docker** has two distinct functions. It is used for starting the Docker 12 daemon and to run the CLI (i.e., to command the daemon to manage images, 13 containers etc.) So **docker** is both a server, as a daemon, and a client 14 to the daemon, through the CLI. 15 16 To run the Docker daemon you do not specify any of the commands listed below but 17 must specify the **-d** option. The other options listed below are for the 18 daemon only. 19 20 The Docker CLI has over 30 commands. The commands are listed below and each has 21 its own man page which explain usage and arguments. 22 23 To see the man page for a command run **man docker <command>**. 24 25 # OPTIONS 26 **-D**=*true*|*false* 27 Enable debug mode. Default is false. 28 29 **-H**, **--host**=[unix:///var/run/docker.sock]: tcp://[host:port] to bind or 30 unix://[/path/to/socket] to use. 31 The socket(s) to bind to in daemon mode specified using one or more 32 tcp://host:port, unix:///path/to/socket, fd://* or fd://socketfd. 33 34 **--api-enable-cors**=*true*|*false* 35 Enable CORS headers in the remote API. Default is false. 36 37 **-b**="" 38 Attach containers to a pre\-existing network bridge; use 'none' to disable container networking 39 40 **--bip**="" 41 Use the provided CIDR notation address for the dynamically created bridge (docker0); Mutually exclusive of \-b 42 43 **-d**=*true*|*false* 44 Enable daemon mode. Default is false. 45 46 **--dns**="" 47 Force Docker to use specific DNS servers 48 49 **-g**="" 50 Path to use as the root of the Docker runtime. Default is `/var/lib/docker`. 51 52 53 **--fixed-cidr**="" 54 IPv4 subnet for fixed IPs (ex: 10.20.0.0/16); this subnet must be nested in the bridge subnet (which is defined by \-b or \-\-bip) 55 56 **--icc**=*true*|*false* 57 Allow unrestricted inter\-container and Docker daemon host communication. If disabled, containers can still be linked together using **--link** option (see **docker-run(1)**). Default is true. 58 59 **--ip**="" 60 Default IP address to use when binding container ports. Default is `0.0.0.0`. 61 62 **--ip-masq**=*true*|*false* 63 Enable IP masquerading for bridge's IP range. Default is true. 64 65 **--iptables**=*true*|*false* 66 Disable Docker's addition of iptables rules. Default is true. 67 68 **-l**, **--log-level**="*debug*|*info*|*error*|*fatal*"" 69 Set the logging level. Default is `info`. 70 71 **--label**="[]" 72 Set key=value labels to the daemon (displayed in `docker info`) 73 74 **--mtu**=VALUE 75 Set the containers network mtu. Default is `1500`. 76 77 **-p**="" 78 Path to use for daemon PID file. Default is `/var/run/docker.pid` 79 80 **--registry-mirror**=<scheme>://<host> 81 Prepend a registry mirror to be used for image pulls. May be specified multiple times. 82 83 **-s**="" 84 Force the Docker runtime to use a specific storage driver. 85 86 **--storage-opt**=[] 87 Set storage driver options. See STORAGE DRIVER OPTIONS. 88 89 **-v**=*true*|*false* 90 Print version information and quit. Default is false. 91 92 **--selinux-enabled**=*true*|*false* 93 Enable selinux support. Default is false. SELinux does not presently support the BTRFS storage driver. 94 95 # COMMANDS 96 **docker-attach(1)** 97 Attach to a running container 98 99 **docker-build(1)** 100 Build an image from a Dockerfile 101 102 **docker-commit(1)** 103 Create a new image from a container's changes 104 105 **docker-cp(1)** 106 Copy files/folders from a container's filesystem to the host at path 107 108 **docker-create(1)** 109 Create a new container 110 111 **docker-diff(1)** 112 Inspect changes on a container's filesystem 113 114 **docker-events(1)** 115 Get real time events from the server 116 117 **docker-exec(1)** 118 Run a command in a running container 119 120 **docker-export(1)** 121 Stream the contents of a container as a tar archive 122 123 **docker-history(1)** 124 Show the history of an image 125 126 **docker-images(1)** 127 List images 128 129 **docker-import(1)** 130 Create a new filesystem image from the contents of a tarball 131 132 **docker-info(1)** 133 Display system-wide information 134 135 **docker-inspect(1)** 136 Return low-level information on a container 137 138 **docker-kill(1)** 139 Kill a running container (which includes the wrapper process and everything 140 inside it) 141 142 **docker-load(1)** 143 Load an image from a tar archive 144 145 **docker-login(1)** 146 Register or Login to a Docker registry server 147 148 **docker-logout(1)** 149 Log the user out of a Docker registry server 150 151 **docker-logs(1)** 152 Fetch the logs of a container 153 154 **docker-pause(1)** 155 Pause all processes within a container 156 157 **docker-port(1)** 158 Lookup the public-facing port which is NAT-ed to PRIVATE_PORT 159 160 **docker-ps(1)** 161 List containers 162 163 **docker-pull(1)** 164 Pull an image or a repository from a Docker registry server 165 166 **docker-push(1)** 167 Push an image or a repository to a Docker registry server 168 169 **docker-restart(1)** 170 Restart a running container 171 172 **docker-rm(1)** 173 Remove one or more containers 174 175 **docker-rmi(1)** 176 Remove one or more images 177 178 **docker-run(1)** 179 Run a command in a new container 180 181 **docker-save(1)** 182 Save an image to a tar archive 183 184 **docker-search(1)** 185 Search for an image in the Docker index 186 187 **docker-start(1)** 188 Start a stopped container 189 190 **docker-stop(1)** 191 Stop a running container 192 193 **docker-tag(1)** 194 Tag an image into a repository 195 196 **docker-top(1)** 197 Lookup the running processes of a container 198 199 **docker-unpause(1)** 200 Unpause all processes within a container 201 202 **docker-version(1)** 203 Show the Docker version information 204 205 **docker-wait(1)** 206 Block until a container stops, then print its exit code 207 208 # STORAGE DRIVER OPTIONS 209 210 Options to storage backend can be specified with **--storage-opt** flags. The 211 only backend which currently takes options is *devicemapper*. Therefore use these 212 flags with **-s=**devicemapper. 213 214 Here is the list of *devicemapper* options: 215 216 #### dm.basesize 217 Specifies the size to use when creating the base device, which limits the size 218 of images and containers. The default value is 10G. Note, thin devices are 219 inherently "sparse", so a 10G device which is mostly empty doesn't use 10 GB 220 of space on the pool. However, the filesystem will use more space for the empty 221 case the larger the device is. **Warning**: This value affects the system-wide 222 "base" empty filesystem that may already be initialized and inherited by pulled 223 images. 224 225 #### dm.loopdatasize 226 Specifies the size to use when creating the loopback file for the "data" 227 device which is used for the thin pool. The default size is 100G. Note that the 228 file is sparse, so it will not initially take up this much space. 229 230 #### dm.loopmetadatasize 231 Specifies the size to use when creating the loopback file for the "metadadata" 232 device which is used for the thin pool. The default size is 2G. Note that the 233 file is sparse, so it will not initially take up this much space. 234 235 #### dm.fs 236 Specifies the filesystem type to use for the base device. The supported 237 options are "ext4" and "xfs". The default is "ext4" 238 239 #### dm.mkfsarg 240 Specifies extra mkfs arguments to be used when creating the base device. 241 242 #### dm.mountopt 243 Specifies extra mount options used when mounting the thin devices. 244 245 #### dm.datadev 246 Specifies a custom blockdevice to use for data for the thin pool. 247 248 If using a block device for device mapper storage, ideally both datadev and 249 metadatadev should be specified to completely avoid using the loopback device. 250 251 #### dm.metadatadev 252 Specifies a custom blockdevice to use for metadata for the thin pool. 253 254 For best performance the metadata should be on a different spindle than the 255 data, or even better on an SSD. 256 257 If setting up a new metadata pool it is required to be valid. This can be 258 achieved by zeroing the first 4k to indicate empty metadata, like this: 259 260 dd if=/dev/zero of=/dev/metadata_dev bs=4096 count=1 261 262 #### dm.blocksize 263 Specifies a custom blocksize to use for the thin pool. The default blocksize 264 is 64K. 265 266 #### dm.blkdiscard 267 Enables or disables the use of blkdiscard when removing devicemapper devices. 268 This is enabled by default (only) if using loopback devices and is required to 269 res-parsify the loopback file on image/container removal. 270 271 Disabling this on loopback can lead to *much* faster container removal times, 272 but will prevent the space used in `/var/lib/docker` directory from being returned to 273 the system for other use when containers are removed. 274 275 # EXAMPLES 276 Launching docker daemon with *devicemapper* backend with particular block devices 277 for data and metadata: 278 279 docker -d -s=devicemapper \ 280 --storage-opt dm.datadev=/dev/vdb \ 281 --storage-opt dm.metadatadev=/dev/vdc \ 282 --storage-opt dm.basesize=20G 283 284 #### Client 285 For specific client examples please see the man page for the specific Docker 286 command. For example: 287 288 man docker run 289 290 # HISTORY 291 April 2014, Originally compiled by William Henry (whenry at redhat dot com) based on docker.com source material and internal work.