2014-04-16 14:07:55 -04:00
% DOCKER(1) Docker User Manuals
% William Henry
% APRIL 2014
# NAME
docker \- Docker image and container command line interface
# SYNOPSIS
**docker** [OPTIONS] COMMAND [arg...]
# DESCRIPTION
**docker** has two distinct functions. It is used for starting the Docker
daemon and to run the CLI (i.e., to command the daemon to manage images,
2014-06-14 03:49:51 -04:00
containers etc.) So **docker** is both a server, as a daemon, and a client
2014-04-16 14:07:55 -04:00
to the daemon, through the CLI.
2014-06-14 03:49:51 -04:00
To run the Docker daemon you do not specify any of the commands listed below but
2014-04-16 14:07:55 -04:00
must specify the ** -d** option. The other options listed below are for the
daemon only.
The Docker CLI has over 30 commands. The commands are listed below and each has
2014-06-14 03:49:51 -04:00
its own man page which explain usage and arguments.
2014-04-16 14:07:55 -04:00
To see the man page for a command run **man docker <command>** .
# OPTIONS
2015-08-10 10:07:50 -04:00
**--help**
2014-10-15 17:14:12 -04:00
Print usage statement
2015-02-09 02:15:07 -05:00
**--api-cors-header**=""
Set CORS headers in the remote API. Default is cors disabled. Give urls like "http://foo, http://bar, ...". Give "*" to allow all.
2015-03-13 03:28:09 -04:00
**-b**, ** --bridge**=""
2014-04-16 14:07:55 -04:00
Attach containers to a pre\-existing network bridge; use 'none' to disable container networking
**--bip**=""
Use the provided CIDR notation address for the dynamically created bridge (docker0); Mutually exclusive of \-b
2015-04-28 11:00:18 -04:00
**--config**=""
Specifies the location of the Docker client configuration files. The default is '~/.docker'.
2015-03-13 03:28:09 -04:00
**-D**, ** --debug**=*true*|*false*
Enable debug mode. Default is false.
**-d**, ** --daemon**=*true*|*false*
2014-04-16 14:07:55 -04:00
Enable daemon mode. Default is false.
2014-12-18 04:09:42 -05:00
**--default-gateway**=""
IPv4 address of the container default gateway; this address must be part of the bridge subnet (which is defined by \-b or \--bip)
**--default-gateway-v6**=""
IPv6 address of the container default gateway
2015-08-03 12:36:37 -04:00
**--default-ulimit**=[]
Set default ulimits for containers.
2014-04-16 14:07:55 -04:00
**--dns**=""
Force Docker to use specific DNS servers
2015-08-31 14:47:25 -04:00
**--dns-opt**=[]
DNS options to use.
2015-08-03 12:36:37 -04:00
**--dns-search**=[]
DNS search domains to use.
2015-03-13 03:28:09 -04:00
**-e**, ** --exec-driver**=""
Force Docker to use specific exec driver. Default is `native` .
2014-04-16 14:07:55 -04:00
2014-11-10 19:19:16 -05:00
**--exec-opt**=[]
Set exec driver options. See EXEC DRIVER OPTIONS.
2015-05-14 22:59:11 -04:00
**--exec-root**=""
2015-08-03 12:36:37 -04:00
Path to use as the root of the Docker exec driver. Default is `/var/run/docker` .
2015-05-14 22:59:11 -04:00
2014-07-21 15:30:21 -04:00
**--fixed-cidr**=""
2015-01-08 18:03:19 -05:00
IPv4 subnet for fixed IPs (e.g., 10.20.0.0/16); this subnet must be nested in the bridge subnet (which is defined by \-b or \-\-bip)
**--fixed-cidr-v6**=""
IPv6 subnet for global IPv6 addresses (e.g., 2a00:1450::/64)
2014-07-21 15:30:21 -04:00
2015-03-13 03:28:09 -04:00
**-G**, ** --group**=""
Group to assign the unix socket specified by -H when running in daemon mode.
use '' (the empty string) to disable setting of a group. Default is `docker` .
**-g**, ** --graph**=""
Path to use as the root of the Docker runtime. Default is `/var/lib/docker` .
**-H**, ** --host**=[unix:///var/run/docker.sock]: tcp://[host:port] to bind or
unix://[/path/to/socket] to use.
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.
2014-04-16 14:07:55 -04:00
**--icc**=*true*|*false*
2014-11-21 17:17:13 -05:00
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.
2014-04-16 14:07:55 -04:00
2015-08-03 12:36:37 -04:00
**--insecure-registry**=[]
2015-09-03 14:10:41 -04:00
Enable insecure registry communication, i.e., enable un-encrypted and/or untrusted communication.
List of insecure registries can contain an element with CIDR notation to specify a whole subnet. Insecure registries accept HTTP and/or accept HTTPS with certificates from unknown CAs.
Enabling `--insecure-registry` is useful when running a local registry. However, because its use creates security vulnerabilities it should ONLY be enabled for testing purposes. For increased security, users should add their CA to their system's list of trusted CAs instead of using `--insecure-registry` .
2015-08-03 12:36:37 -04:00
2014-04-16 14:07:55 -04:00
**--ip**=""
Default IP address to use when binding container ports. Default is `0.0.0.0` .
2015-01-08 18:03:19 -05:00
**--ip-forward**=*true*|*false*
2015-06-03 04:37:40 -04:00
Enables IP forwarding on the Docker host. The default is `true` . This flag interacts with the IP forwarding setting on your host system's kernel. If your system has IP forwarding disabled, this setting enables it. If your system has IP forwarding enabled, setting this flag to `--ip-forward=false` has no effect.
This setting will also enable IPv6 forwarding if you have both `--ip-forward=true` and `--fixed-cidr-v6` set. Note that this may reject Router Advertisements and interfere with the host's existing IPv6 configuration. For more information, please consult the documentation about "Advanced Networking - IPv6".
2015-01-08 18:03:19 -05:00
2014-09-16 23:00:15 -04:00
**--ip-masq**=*true*|*false*
Enable IP masquerading for bridge's IP range. Default is true.
2014-04-16 14:07:55 -04:00
**--iptables**=*true*|*false*
2015-03-13 03:28:09 -04:00
Enable Docker's addition of iptables rules. Default is true.
2014-04-16 14:07:55 -04:00
2015-01-08 18:03:19 -05:00
**--ipv6**=*true*|*false*
Enable IPv6 support. Default is false. Docker will create an IPv6-enabled bridge with address fe80::1 which will allow you to create IPv6-enabled containers. Use together with `--fixed-cidr-v6` to provide globally routable IPv6 addresses. IPv6 forwarding will be enabled if not used with `--ip-forward=false` . This may collide with your host's current IPv6 settings. For more information please consult the documentation about "Advanced Networking - IPv6".
2015-01-15 15:19:19 -05:00
**-l**, ** --log-level**="*debug*|*info*|*warn*|*error*|*fatal*""
2014-10-01 09:07:24 -04:00
Set the logging level. Default is `info` .
2014-11-20 13:36:05 -05:00
**--label**="[]"
2014-11-21 14:15:22 -05:00
Set key=value labels to the daemon (displayed in `docker info` )
2014-11-20 13:36:05 -05:00
2015-08-04 20:35:06 -04:00
**--log-driver**="*json-file*|*syslog*|*journald*|*gelf*|*fluentd*|*awslogs*|*none*"
2015-04-08 19:37:39 -04:00
Default driver for container logs. Default is `json-file` .
Add log reading to the journald log driver
If a logdriver doesn't register a callback function to validate log
options, it won't be usable. Fix the journald driver by adding a dummy
validator.
Teach the client and the daemon's "logs" logic that the server can also
supply "logs" data via the "journald" driver. Update documentation and
tests that depend on error messages.
Add support for reading log data from the systemd journal to the
journald log driver. The internal logic uses a goroutine to scan the
journal for matching entries after any specified cutoff time, formats
the messages from those entries as JSONLog messages, and stuffs the
results down a pipe whose reading end we hand back to the caller.
If we are missing any of the 'linux', 'cgo', or 'journald' build tags,
however, we don't implement a reader, so the 'logs' endpoint will still
return an error.
Make the necessary changes to the build setup to ensure that support for
reading container logs from the systemd journal is built.
Rename the Jmap member of the journald logdriver's struct to "vars" to
make it non-public, and to make it easier to tell that it's just there
to hold additional variable values that we want journald to record along
with log data that we're sending to it.
In the client, don't assume that we know which logdrivers the server
implements, and remove the check that looks at the server. It's
redundant because the server already knows, and the check also makes
using older clients with newer servers (which may have new logdrivers in
them) unnecessarily hard.
When we try to "logs" and have to report that the container's logdriver
doesn't support reading, send the error message through the
might-be-a-multiplexer so that clients which are expecting multiplexed
data will be able to properly display the error, instead of tripping
over the data and printing a less helpful "Unrecognized input header"
error.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com> (github: nalind)
2015-07-23 11:02:56 -04:00
**Warning** : the `docker logs` command works only for the `json-file` and
`journald` logging drivers.
2015-02-05 19:24:47 -05:00
2015-05-21 16:20:25 -04:00
**--log-opt**=[]
Logging driver specific options.
2014-04-16 14:07:55 -04:00
**--mtu**=VALUE
2015-03-13 03:28:09 -04:00
Set the containers network mtu. Default is `0` .
2014-04-16 14:07:55 -04:00
2015-03-13 03:28:09 -04:00
**-p**, ** --pidfile**=""
2014-04-16 14:07:55 -04:00
Path to use for daemon PID file. Default is `/var/run/docker.pid`
2014-11-06 09:09:09 -05:00
**--registry-mirror**=< scheme > ://< host >
2014-07-18 14:48:19 -04:00
Prepend a registry mirror to be used for image pulls. May be specified multiple times.
2015-03-13 03:28:09 -04:00
**-s**, ** --storage-driver**=""
2014-04-16 14:07:55 -04:00
Force the Docker runtime to use a specific storage driver.
2014-11-10 19:19:16 -05:00
**--selinux-enabled**=*true*|*false*
Enable selinux support. Default is false. SELinux does not presently support the BTRFS storage driver.
2014-11-06 10:58:07 -05:00
**--storage-opt**=[]
Set storage driver options. See STORAGE DRIVER OPTIONS.
2015-08-03 12:36:37 -04:00
**--tls**=*true*|*false*
2015-03-13 03:28:09 -04:00
Use TLS; implied by --tlsverify. Default is false.
2015-08-03 12:36:37 -04:00
**--tlscacert**=~/.docker/ca.pem
Trust certs signed only by this CA.
**--tlscert**=~/.docker/cert.pem
Path to TLS certificate file.
**--tlskey**=~/.docker/key.pem
Path to TLS key file.
**--tlsverify**=*true*|*false*
2015-03-13 03:28:09 -04:00
Use TLS and verify the remote (daemon: verify client, client: verify daemon).
Default is false.
2014-11-10 19:19:16 -05:00
**--userland-proxy**=*true*|*false*
2015-09-16 12:55:14 -04:00
Rely on a userland proxy implementation for inter-container and outside-to-container loopback communications. Default is true.
2014-11-10 19:19:16 -05:00
2015-03-13 03:28:09 -04:00
**-v**, ** --version**=*true*|*false*
2014-04-16 14:07:55 -04:00
Print version information and quit. Default is false.
# COMMANDS
2015-04-27 08:54:51 -04:00
**attach**
2014-04-16 14:07:55 -04:00
Attach to a running container
2015-04-27 08:54:51 -04:00
See **docker-attach(1)** for full documentation on the **attach** command.
2014-04-16 14:07:55 -04:00
2015-04-27 08:54:51 -04:00
**build**
2014-05-08 09:11:17 -04:00
Build an image from a Dockerfile
2015-04-27 08:54:51 -04:00
See **docker-build(1)** for full documentation on the **build** command.
2014-04-16 14:07:55 -04:00
2015-04-27 08:54:51 -04:00
**commit**
2014-04-16 14:07:55 -04:00
Create a new image from a container's changes
2015-04-27 08:54:51 -04:00
See **docker-commit(1)** for full documentation on the **commit** command.
2014-04-16 14:07:55 -04:00
2015-04-27 08:54:51 -04:00
**cp**
2015-03-05 11:39:32 -05:00
Copy files/folders from a container's filesystem to the host
2015-04-27 08:54:51 -04:00
See **docker-cp(1)** for full documentation on the **cp** command.
2014-04-16 14:07:55 -04:00
2015-04-27 08:54:51 -04:00
**create**
2014-08-19 21:10:42 -04:00
Create a new container
2015-04-27 08:54:51 -04:00
See **docker-create(1)** for full documentation on the **create** command.
2014-08-19 21:10:42 -04:00
2015-04-27 08:54:51 -04:00
**diff**
2014-04-16 14:07:55 -04:00
Inspect changes on a container's filesystem
2015-04-27 08:54:51 -04:00
See **docker-diff(1)** for full documentation on the **diff** command.
2014-04-16 14:07:55 -04:00
2015-04-27 08:54:51 -04:00
**events**
2014-04-16 14:07:55 -04:00
Get real time events from the server
2015-04-27 08:54:51 -04:00
See **docker-events(1)** for full documentation on the **events** command.
2014-04-16 14:07:55 -04:00
2015-04-27 08:54:51 -04:00
**exec**
2014-09-17 14:36:51 -04:00
Run a command in a running container
2015-04-27 08:54:51 -04:00
See **docker-exec(1)** for full documentation on the **exec** command.
2014-09-17 14:37:47 -04:00
2015-04-27 08:54:51 -04:00
**export**
2014-04-16 14:07:55 -04:00
Stream the contents of a container as a tar archive
2015-04-27 08:54:51 -04:00
See **docker-export(1)** for full documentation on the **export** command.
2014-04-16 14:07:55 -04:00
2015-04-27 08:54:51 -04:00
**history**
2014-04-16 14:07:55 -04:00
Show the history of an image
2015-04-27 08:54:51 -04:00
See **docker-history(1)** for full documentation on the **history** command.
2014-04-16 14:07:55 -04:00
2015-04-27 08:54:51 -04:00
**images**
2014-04-16 14:07:55 -04:00
List images
2015-04-27 08:54:51 -04:00
See **docker-images(1)** for full documentation on the **images** command.
2014-04-16 14:07:55 -04:00
2015-04-27 08:54:51 -04:00
**import**
2014-04-16 14:07:55 -04:00
Create a new filesystem image from the contents of a tarball
2015-04-27 08:54:51 -04:00
See **docker-import(1)** for full documentation on the **import** command.
2014-04-16 14:07:55 -04:00
2015-04-27 08:54:51 -04:00
**info**
2014-04-16 14:07:55 -04:00
Display system-wide information
2015-04-27 08:54:51 -04:00
See **docker-info(1)** for full documentation on the **info** command.
2014-04-16 14:07:55 -04:00
2015-04-27 08:54:51 -04:00
**inspect**
2015-01-24 02:05:44 -05:00
Return low-level information on a container or image
2015-04-27 08:54:51 -04:00
See **docker-inspect(1)** for full documentation on the **inspect** command.
2014-04-16 14:07:55 -04:00
2015-04-27 08:54:51 -04:00
**kill**
2014-04-16 14:07:55 -04:00
Kill a running container (which includes the wrapper process and everything
inside it)
2015-04-27 08:54:51 -04:00
See **docker-kill(1)** for full documentation on the **kill** command.
2014-04-16 14:07:55 -04:00
2015-04-27 08:54:51 -04:00
**load**
2014-04-16 14:07:55 -04:00
Load an image from a tar archive
2015-04-27 08:54:51 -04:00
See **docker-load(1)** for full documentation on the **load** command.
2014-04-16 14:07:55 -04:00
2015-04-27 08:54:51 -04:00
**login**
2015-04-18 20:42:24 -04:00
Register or login to a Docker Registry
2015-04-27 08:54:51 -04:00
See **docker-login(1)** for full documentation on the **login** command.
2014-04-16 14:07:55 -04:00
2015-04-27 08:54:51 -04:00
**logout**
2015-04-18 20:42:24 -04:00
Log the user out of a Docker Registry
2015-04-27 08:54:51 -04:00
See **docker-logout(1)** for full documentation on the **logout** command.
2014-06-27 02:52:36 -04:00
2015-04-27 08:54:51 -04:00
**logs**
2014-04-16 14:07:55 -04:00
Fetch the logs of a container
2015-04-27 08:54:51 -04:00
See **docker-logs(1)** for full documentation on the **logs** command.
2014-04-16 14:07:55 -04:00
2015-04-27 08:54:51 -04:00
**pause**
2014-06-30 22:58:04 -04:00
Pause all processes within a container
2015-04-27 08:54:51 -04:00
See **docker-pause(1)** for full documentation on the **pause** command.
2014-06-30 22:58:04 -04:00
2015-04-27 08:54:51 -04:00
**port**
2014-04-16 14:07:55 -04:00
Lookup the public-facing port which is NAT-ed to PRIVATE_PORT
2015-04-27 08:54:51 -04:00
See **docker-port(1)** for full documentation on the **port** command.
2014-04-16 14:07:55 -04:00
2015-04-27 08:54:51 -04:00
**ps**
2014-04-16 14:07:55 -04:00
List containers
2015-04-27 08:54:51 -04:00
See **docker-ps(1)** for full documentation on the **ps** command.
2014-04-16 14:07:55 -04:00
2015-04-27 08:54:51 -04:00
**pull**
2015-04-18 20:42:24 -04:00
Pull an image or a repository from a Docker Registry
2015-04-27 08:54:51 -04:00
See **docker-pull(1)** for full documentation on the **pull** command.
2014-04-16 14:07:55 -04:00
2015-04-27 08:54:51 -04:00
**push**
2015-04-18 20:42:24 -04:00
Push an image or a repository to a Docker Registry
2015-04-27 08:54:51 -04:00
See **docker-push(1)** for full documentation on the **push** command.
2014-04-16 14:07:55 -04:00
2015-08-03 12:36:37 -04:00
**rename**
Rename a container.
See **docker-rename(1)** for full documentation on the **rename** command.
2015-04-27 08:54:51 -04:00
**restart**
2014-04-16 14:07:55 -04:00
Restart a running container
2015-04-27 08:54:51 -04:00
See **docker-restart(1)** for full documentation on the **restart** command.
2014-04-16 14:07:55 -04:00
2015-04-27 08:54:51 -04:00
**rm**
2014-04-16 14:07:55 -04:00
Remove one or more containers
2015-04-27 08:54:51 -04:00
See **docker-rm(1)** for full documentation on the **rm** command.
2014-04-16 14:07:55 -04:00
2015-04-27 08:54:51 -04:00
**rmi**
2014-04-16 14:07:55 -04:00
Remove one or more images
2015-04-27 08:54:51 -04:00
See **docker-rmi(1)** for full documentation on the **rmi** command.
2014-04-16 14:07:55 -04:00
2015-04-27 08:54:51 -04:00
**run**
2014-04-16 14:07:55 -04:00
Run a command in a new container
2015-04-27 08:54:51 -04:00
See **docker-run(1)** for full documentation on the **run** command.
2014-04-16 14:07:55 -04:00
2015-04-27 08:54:51 -04:00
**save**
2014-04-16 14:07:55 -04:00
Save an image to a tar archive
2015-04-27 08:54:51 -04:00
See **docker-save(1)** for full documentation on the **save** command.
2014-04-16 14:07:55 -04:00
2015-04-27 08:54:51 -04:00
**search**
2014-04-16 14:07:55 -04:00
Search for an image in the Docker index
2015-04-27 08:54:51 -04:00
See **docker-search(1)** for full documentation on the **search** command.
2014-04-16 14:07:55 -04:00
2015-04-27 08:54:51 -04:00
**start**
2014-04-16 14:07:55 -04:00
Start a stopped container
2015-04-27 08:54:51 -04:00
See **docker-start(1)** for full documentation on the **start** command.
2014-04-16 14:07:55 -04:00
2015-04-27 08:54:51 -04:00
**stats**
2015-03-13 03:28:09 -04:00
Display a live stream of one or more containers' resource usage statistics
2015-04-27 08:54:51 -04:00
See **docker-stats(1)** for full documentation on the **stats** command.
2015-03-13 03:28:09 -04:00
2015-04-27 08:54:51 -04:00
**stop**
2014-04-16 14:07:55 -04:00
Stop a running container
2015-04-27 08:54:51 -04:00
See **docker-stop(1)** for full documentation on the **stop** command.
2014-04-16 14:07:55 -04:00
2015-04-27 08:54:51 -04:00
**tag**
2014-04-16 14:07:55 -04:00
Tag an image into a repository
2015-04-27 08:54:51 -04:00
See **docker-tag(1)** for full documentation on the **tag** command.
2014-04-16 14:07:55 -04:00
2015-04-27 08:54:51 -04:00
**top**
2014-04-16 14:07:55 -04:00
Lookup the running processes of a container
2015-04-27 08:54:51 -04:00
See **docker-top(1)** for full documentation on the **top** command.
2014-04-16 14:07:55 -04:00
2015-04-27 08:54:51 -04:00
**unpause**
2014-06-30 22:58:04 -04:00
Unpause all processes within a container
2015-04-27 08:54:51 -04:00
See **docker-unpause(1)** for full documentation on the **unpause** command.
2014-06-30 22:58:04 -04:00
2015-04-27 08:54:51 -04:00
**version**
2014-04-16 14:07:55 -04:00
Show the Docker version information
2015-04-27 08:54:51 -04:00
See **docker-version(1)** for full documentation on the **version** command.
2014-04-16 14:07:55 -04:00
2015-04-27 08:54:51 -04:00
**wait**
2014-04-16 14:07:55 -04:00
Block until a container stops, then print its exit code
2015-04-27 08:54:51 -04:00
See **docker-wait(1)** for full documentation on the **wait** command.
2014-04-16 14:07:55 -04:00
2014-11-06 10:58:07 -05:00
# STORAGE DRIVER OPTIONS
2015-06-28 23:04:24 -04:00
Docker uses storage backends (known as "graphdrivers" in the Docker
internals) to create writable containers from images. Many of these
backends use operating system level technologies and can be
configured.
Specify options to the storage backend with ** --storage-opt** flags. The only
backend that currently takes options is *devicemapper* . Therefore use these
2014-11-06 10:58:07 -05:00
flags with ** -s=**devicemapper.
2015-06-28 23:04:24 -04:00
Specifically for devicemapper, the default is a "loopback" model which
requires no pre-configuration, but is extremely inefficient. Do not
use it in production.
To make the best use of Docker with the devicemapper backend, you must
have a recent version of LVM. Use `lvm` to create a thin pool; for
more information see `man lvmthin` . Then, use `--storage-opt
dm.thinpooldev` to tell the Docker engine to use that pool for
allocating images and container snapshots.
2014-11-06 10:58:07 -05:00
Here is the list of *devicemapper* options:
2015-06-28 23:04:24 -04:00
#### dm.thinpooldev
Specifies a custom block storage device to use for the thin pool.
If using a block device for device mapper storage, it is best to use
`lvm` to create and manage the thin-pool volume. This volume is then
handed to Docker to create snapshot volumes needed for images and
containers.
Managing the thin-pool outside of Docker makes for the most feature-rich method
of having Docker utilize device mapper thin provisioning as the backing storage
for Docker's containers. The highlights of the LVM-based thin-pool management
feature include: automatic or interactive thin-pool resize support, dynamically
changing thin-pool features, automatic thinp metadata checking when lvm activates
the thin-pool, etc.
2015-08-10 08:48:08 -04:00
Example use: `docker daemon --storage-opt dm.thinpooldev=/dev/mapper/thin-pool`
2015-06-28 23:04:24 -04:00
2014-11-06 10:58:07 -05:00
#### dm.basesize
2015-06-28 23:04:24 -04:00
Specifies the size to use when creating the base device, which limits
2015-07-21 08:46:31 -04:00
the size of images and containers. The default value is 100G. Note,
thin devices are inherently "sparse", so a 100G device which is mostly
empty doesn't use 100 GB of space on the pool. However, the filesystem
2015-06-28 23:04:24 -04:00
will use more space for base images the larger the device
is.
2014-11-06 10:58:07 -05:00
2015-06-28 23:04:24 -04:00
This value affects the system-wide "base" empty filesystem that may already
be initialized and inherited by pulled images. Typically, a change to this
value requires additional steps to take effect:
$ sudo service docker stop
$ sudo rm -rf /var/lib/docker
$ sudo service docker start
2015-08-10 08:48:08 -04:00
Example use: `docker daemon --storage-opt dm.basesize=20G`
2014-11-06 10:58:07 -05:00
#### dm.fs
2015-06-28 23:04:24 -04:00
Specifies the filesystem type to use for the base device. The
supported options are `ext4` and `xfs` . The default is `ext4` .
2015-08-10 08:48:08 -04:00
Example use: `docker daemon --storage-opt dm.fs=xfs`
2014-11-06 10:58:07 -05:00
#### dm.mkfsarg
2015-06-28 23:04:24 -04:00
2014-11-20 19:36:37 -05:00
Specifies extra mkfs arguments to be used when creating the base device.
2014-11-06 10:58:07 -05:00
2015-08-10 08:48:08 -04:00
Example use: `docker daemon --storage-opt "dm.mkfsarg=-O ^has_journal"`
2015-06-28 23:04:24 -04:00
2014-11-06 10:58:07 -05:00
#### dm.mountopt
2015-06-28 23:04:24 -04:00
2014-11-20 19:36:37 -05:00
Specifies extra mount options used when mounting the thin devices.
2014-11-06 10:58:07 -05:00
2015-08-10 08:48:08 -04:00
Example use: `docker daemon --storage-opt dm.mountopt=nodiscard`
2015-06-28 23:04:24 -04:00
#### dm.use_deferred_removal
Enables use of deferred device removal if `libdm` and the kernel driver
support the mechanism.
Deferred device removal means that if device is busy when devices are
being removed/deactivated, then a deferred removal is scheduled on
device. And devices automatically go away when last user of the device
exits.
For example, when a container exits, its associated thin device is removed. If
that device has leaked into some other mount namespace and can't be removed,
the container exit still succeeds and this option causes the system to schedule
the device for deferred removal. It does not wait in a loop trying to remove a busy
device.
2015-08-10 08:48:08 -04:00
Example use: `docker daemon --storage-opt dm.use_deferred_removal=true`
2015-06-28 23:04:24 -04:00
#### dm.loopdatasize
**Note**: This option configures devicemapper loopback, which should not be used in production.
Specifies the size to use when creating the loopback file for the
"data" device which is used for the thin pool. The default size is
100G. The file is sparse, so it will not initially take up
this much space.
2015-08-10 08:48:08 -04:00
Example use: `docker daemon --storage-opt dm.loopdatasize=200G`
2015-06-28 23:04:24 -04:00
#### dm.loopmetadatasize
**Note**: This option configures devicemapper loopback, which should not be used in production.
Specifies the size to use when creating the loopback file for the
2015-08-03 12:36:37 -04:00
"metadata" device which is used for the thin pool. The default size
2015-06-28 23:04:24 -04:00
is 2G. The file is sparse, so it will not initially take up
this much space.
2015-08-10 08:48:08 -04:00
Example use: `docker daemon --storage-opt dm.loopmetadatasize=4G`
2015-06-28 23:04:24 -04:00
2014-11-06 10:58:07 -05:00
#### dm.datadev
2015-06-28 23:04:24 -04:00
(Deprecated, use `dm.thinpooldev` )
2014-11-06 10:58:07 -05:00
2015-06-28 23:04:24 -04:00
Specifies a custom blockdevice to use for data for a
Docker-managed thin pool. It is better to use `dm.thinpooldev` - see
the documentation for it above for discussion of the advantages.
2014-11-06 10:58:07 -05:00
2015-06-28 23:04:24 -04:00
#### dm.metadatadev
2014-11-06 10:58:07 -05:00
2015-06-28 23:04:24 -04:00
(Deprecated, use `dm.thinpooldev` )
2014-11-06 10:58:07 -05:00
2015-06-28 23:04:24 -04:00
Specifies a custom blockdevice to use for metadata for a
Docker-managed thin pool. See `dm.datadev` for why this is
deprecated.
2014-11-06 10:58:07 -05:00
#### dm.blocksize
2015-06-28 23:04:24 -04:00
Specifies a custom blocksize to use for the thin pool. The default
blocksize is 64K.
2015-08-10 08:48:08 -04:00
Example use: `docker daemon --storage-opt dm.blocksize=512K`
2014-11-06 10:58:07 -05:00
#### dm.blkdiscard
2015-06-28 23:04:24 -04:00
Enables or disables the use of `blkdiscard` when removing devicemapper
devices. This is disabled by default due to the additional latency,
but as a special case with loopback devices it will be enabled, in
order to re-sparsify the loopback file on image/container removal.
Disabling this on loopback can lead to *much* faster container removal
times, but it also prevents the space used in `/var/lib/docker` directory
from being returned to the system for other use when containers are
removed.
2015-08-10 08:48:08 -04:00
Example use: `docker daemon --storage-opt dm.blkdiscard=false`
2015-06-28 23:04:24 -04:00
2015-07-07 15:27:19 -04:00
#### dm.override_udev_sync_check
By default, the devicemapper backend attempts to synchronize with the
`udev` device manager for the Linux kernel. This option allows
disabling that synchronization, to continue even though the
configuration may be buggy.
To view the `udev` sync support of a Docker daemon that is using the
`devicemapper` driver, run:
$ docker info
[...]
Udev Sync Supported: true
[...]
When `udev` sync support is `true` , then `devicemapper` and `udev` can
coordinate the activation and deactivation of devices for containers.
When `udev` sync support is `false` , a race condition occurs between
2015-08-03 12:36:37 -04:00
the `devicemapper` and `udev` during create and cleanup. The race
2015-07-07 15:27:19 -04:00
condition results in errors and failures. (For information on these
failures, see
[docker#4036 ](https://github.com/docker/docker/issues/4036 ))
To allow the `docker` daemon to start, regardless of whether `udev` sync is
`false` , set `dm.override_udev_sync_check` to true:
2015-08-10 08:48:08 -04:00
$ docker daemon --storage-opt dm.override_udev_sync_check=true
2015-07-07 15:27:19 -04:00
When this value is `true` , the driver continues and simply warns you
the errors are happening.
**Note**: The ideal is to pursue a `docker` daemon and environment
that does support synchronizing with `udev` . For further discussion on
this topic, see
[docker#4036 ](https://github.com/docker/docker/issues/4036 ).
Otherwise, set this flag for migrating existing Docker daemons to a
daemon with a supported environment.
2015-01-28 17:54:25 -05:00
# EXEC DRIVER OPTIONS
2015-04-06 14:47:55 -04:00
Use the ** --exec-opt** flags to specify options to the exec-driver. The only
driver that accepts this flag is the *native* (libcontainer) driver. As a
result, you must also specify ** -s=**native for this option to have effect. The
following is the only *native* option:
2015-01-28 17:54:25 -05:00
#### native.cgroupdriver
2015-04-06 14:47:55 -04:00
Specifies the management of the container's `cgroups` . You can specify
`cgroupfs` or `systemd` . If you specify `systemd` and it is not available, the
system uses `cgroupfs` .
2015-01-28 17:54:25 -05:00
2014-11-06 10:58:07 -05:00
#### Client
2014-11-20 19:36:37 -05:00
For specific client examples please see the man page for the specific Docker
command. For example:
2014-04-16 14:07:55 -04:00
2015-02-22 15:39:43 -05:00
man docker-run
2014-04-16 14:07:55 -04:00
# HISTORY
2014-11-06 10:58:07 -05:00
April 2014, Originally compiled by William Henry (whenry at redhat dot com) based on docker.com source material and internal work.