2014-04-16 18:07:55 +00:00
|
|
|
% DOCKER(1) Docker User Manuals
|
|
|
|
% William Henry
|
|
|
|
% APRIL 2014
|
|
|
|
# NAME
|
|
|
|
docker \- Docker image and container command line interface
|
|
|
|
|
|
|
|
# SYNOPSIS
|
|
|
|
**docker** [OPTIONS] COMMAND [arg...]
|
|
|
|
|
2015-11-10 01:33:55 +00:00
|
|
|
**docker** daemon [--help|...]
|
2015-09-17 14:07:22 +00:00
|
|
|
|
2015-11-10 01:33:55 +00:00
|
|
|
**docker** [--help|-v|--version]
|
2015-09-17 14:07:22 +00:00
|
|
|
|
2014-04-16 18:07:55 +00:00
|
|
|
# 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 07:49:51 +00:00
|
|
|
containers etc.) So **docker** is both a server, as a daemon, and a client
|
2014-04-16 18:07:55 +00:00
|
|
|
to the daemon, through the CLI.
|
|
|
|
|
2015-09-17 14:07:22 +00:00
|
|
|
To run the Docker daemon you can specify **docker daemon**.
|
|
|
|
You can view the daemon options using **docker daemon --help**.
|
|
|
|
To see the man page for the daemon, run **man docker daemon**.
|
2014-04-16 18:07:55 +00:00
|
|
|
|
|
|
|
The Docker CLI has over 30 commands. The commands are listed below and each has
|
2014-06-14 07:49:51 +00:00
|
|
|
its own man page which explain usage and arguments.
|
2014-04-16 18:07:55 +00:00
|
|
|
|
|
|
|
To see the man page for a command run **man docker <command>**.
|
|
|
|
|
|
|
|
# OPTIONS
|
2015-08-10 14:07:50 +00:00
|
|
|
**--help**
|
2014-10-15 21:14:12 +00:00
|
|
|
Print usage statement
|
|
|
|
|
2015-04-28 15:00:18 +00:00
|
|
|
**--config**=""
|
|
|
|
Specifies the location of the Docker client configuration files. The default is '~/.docker'.
|
|
|
|
|
2015-03-13 07:28:09 +00:00
|
|
|
**-D**, **--debug**=*true*|*false*
|
|
|
|
Enable debug mode. Default is false.
|
|
|
|
|
2015-11-10 01:33:55 +00:00
|
|
|
**-H**, **--host**=[*unix:///var/run/docker.sock*]: tcp://[host]:[port][path] to bind or
|
2015-03-13 07:28:09 +00:00
|
|
|
unix://[/path/to/socket] to use.
|
|
|
|
The socket(s) to bind to in daemon mode specified using one or more
|
2015-08-21 13:28:49 +00:00
|
|
|
tcp://host:port/path, unix:///path/to/socket, fd://* or fd://socketfd.
|
|
|
|
If the tcp port is not specified, then it will default to either `2375` when
|
|
|
|
`--tls` is off, or `2376` when `--tls` is on, or `--tlsverify` is specified.
|
2015-03-13 07:28:09 +00:00
|
|
|
|
2015-11-10 01:33:55 +00:00
|
|
|
**-l**, **--log-level**="*debug*|*info*|*warn*|*error*|*fatal*"
|
2014-10-01 13:07:24 +00:00
|
|
|
Set the logging level. Default is `info`.
|
|
|
|
|
2015-08-03 16:36:37 +00:00
|
|
|
**--tls**=*true*|*false*
|
2015-03-13 07:28:09 +00:00
|
|
|
Use TLS; implied by --tlsverify. Default is false.
|
|
|
|
|
2015-11-10 01:33:55 +00:00
|
|
|
**--tlscacert**=*~/.docker/ca.pem*
|
2015-08-03 16:36:37 +00:00
|
|
|
Trust certs signed only by this CA.
|
|
|
|
|
2015-11-10 01:33:55 +00:00
|
|
|
**--tlscert**=*~/.docker/cert.pem*
|
2015-08-03 16:36:37 +00:00
|
|
|
Path to TLS certificate file.
|
|
|
|
|
2015-11-10 01:33:55 +00:00
|
|
|
**--tlskey**=*~/.docker/key.pem*
|
2015-08-03 16:36:37 +00:00
|
|
|
Path to TLS key file.
|
|
|
|
|
|
|
|
**--tlsverify**=*true*|*false*
|
2015-03-13 07:28:09 +00:00
|
|
|
Use TLS and verify the remote (daemon: verify client, client: verify daemon).
|
|
|
|
Default is false.
|
|
|
|
|
|
|
|
**-v**, **--version**=*true*|*false*
|
2014-04-16 18:07:55 +00:00
|
|
|
Print version information and quit. Default is false.
|
|
|
|
|
|
|
|
# COMMANDS
|
2015-04-27 12:54:51 +00:00
|
|
|
**attach**
|
2014-04-16 18:07:55 +00:00
|
|
|
Attach to a running container
|
2015-04-27 12:54:51 +00:00
|
|
|
See **docker-attach(1)** for full documentation on the **attach** command.
|
2014-04-16 18:07:55 +00:00
|
|
|
|
2015-04-27 12:54:51 +00:00
|
|
|
**build**
|
2014-05-08 13:11:17 +00:00
|
|
|
Build an image from a Dockerfile
|
2015-04-27 12:54:51 +00:00
|
|
|
See **docker-build(1)** for full documentation on the **build** command.
|
2014-04-16 18:07:55 +00:00
|
|
|
|
2015-04-27 12:54:51 +00:00
|
|
|
**commit**
|
2014-04-16 18:07:55 +00:00
|
|
|
Create a new image from a container's changes
|
2015-04-27 12:54:51 +00:00
|
|
|
See **docker-commit(1)** for full documentation on the **commit** command.
|
2014-04-16 18:07:55 +00:00
|
|
|
|
2015-04-27 12:54:51 +00:00
|
|
|
**cp**
|
2015-09-20 10:02:28 +00:00
|
|
|
Copy files/folders between a container and the local filesystem
|
2015-04-27 12:54:51 +00:00
|
|
|
See **docker-cp(1)** for full documentation on the **cp** command.
|
2014-04-16 18:07:55 +00:00
|
|
|
|
2015-04-27 12:54:51 +00:00
|
|
|
**create**
|
2014-08-20 01:10:42 +00:00
|
|
|
Create a new container
|
2015-04-27 12:54:51 +00:00
|
|
|
See **docker-create(1)** for full documentation on the **create** command.
|
2014-08-20 01:10:42 +00:00
|
|
|
|
2015-04-27 12:54:51 +00:00
|
|
|
**diff**
|
2014-04-16 18:07:55 +00:00
|
|
|
Inspect changes on a container's filesystem
|
2015-04-27 12:54:51 +00:00
|
|
|
See **docker-diff(1)** for full documentation on the **diff** command.
|
2014-04-16 18:07:55 +00:00
|
|
|
|
2015-04-27 12:54:51 +00:00
|
|
|
**events**
|
2014-04-16 18:07:55 +00:00
|
|
|
Get real time events from the server
|
2015-04-27 12:54:51 +00:00
|
|
|
See **docker-events(1)** for full documentation on the **events** command.
|
2014-04-16 18:07:55 +00:00
|
|
|
|
2015-04-27 12:54:51 +00:00
|
|
|
**exec**
|
2014-09-17 18:36:51 +00:00
|
|
|
Run a command in a running container
|
2015-04-27 12:54:51 +00:00
|
|
|
See **docker-exec(1)** for full documentation on the **exec** command.
|
2014-09-17 18:37:47 +00:00
|
|
|
|
2015-04-27 12:54:51 +00:00
|
|
|
**export**
|
2014-04-16 18:07:55 +00:00
|
|
|
Stream the contents of a container as a tar archive
|
2015-04-27 12:54:51 +00:00
|
|
|
See **docker-export(1)** for full documentation on the **export** command.
|
2014-04-16 18:07:55 +00:00
|
|
|
|
2015-04-27 12:54:51 +00:00
|
|
|
**history**
|
2014-04-16 18:07:55 +00:00
|
|
|
Show the history of an image
|
2015-04-27 12:54:51 +00:00
|
|
|
See **docker-history(1)** for full documentation on the **history** command.
|
2014-04-16 18:07:55 +00:00
|
|
|
|
2015-04-27 12:54:51 +00:00
|
|
|
**images**
|
2014-04-16 18:07:55 +00:00
|
|
|
List images
|
2015-04-27 12:54:51 +00:00
|
|
|
See **docker-images(1)** for full documentation on the **images** command.
|
2014-04-16 18:07:55 +00:00
|
|
|
|
2015-04-27 12:54:51 +00:00
|
|
|
**import**
|
2014-04-16 18:07:55 +00:00
|
|
|
Create a new filesystem image from the contents of a tarball
|
2015-04-27 12:54:51 +00:00
|
|
|
See **docker-import(1)** for full documentation on the **import** command.
|
2014-04-16 18:07:55 +00:00
|
|
|
|
2015-04-27 12:54:51 +00:00
|
|
|
**info**
|
2014-04-16 18:07:55 +00:00
|
|
|
Display system-wide information
|
2015-04-27 12:54:51 +00:00
|
|
|
See **docker-info(1)** for full documentation on the **info** command.
|
2014-04-16 18:07:55 +00:00
|
|
|
|
2015-04-27 12:54:51 +00:00
|
|
|
**inspect**
|
2015-01-24 07:05:44 +00:00
|
|
|
Return low-level information on a container or image
|
2015-04-27 12:54:51 +00:00
|
|
|
See **docker-inspect(1)** for full documentation on the **inspect** command.
|
2014-04-16 18:07:55 +00:00
|
|
|
|
2015-04-27 12:54:51 +00:00
|
|
|
**kill**
|
2014-04-16 18:07:55 +00:00
|
|
|
Kill a running container (which includes the wrapper process and everything
|
|
|
|
inside it)
|
2015-04-27 12:54:51 +00:00
|
|
|
See **docker-kill(1)** for full documentation on the **kill** command.
|
2014-04-16 18:07:55 +00:00
|
|
|
|
2015-04-27 12:54:51 +00:00
|
|
|
**load**
|
2014-04-16 18:07:55 +00:00
|
|
|
Load an image from a tar archive
|
2015-04-27 12:54:51 +00:00
|
|
|
See **docker-load(1)** for full documentation on the **load** command.
|
2014-04-16 18:07:55 +00:00
|
|
|
|
2015-04-27 12:54:51 +00:00
|
|
|
**login**
|
2016-03-01 16:28:42 +00:00
|
|
|
Log in to a Docker Registry
|
2015-04-27 12:54:51 +00:00
|
|
|
See **docker-login(1)** for full documentation on the **login** command.
|
2014-04-16 18:07:55 +00:00
|
|
|
|
2015-04-27 12:54:51 +00:00
|
|
|
**logout**
|
2015-04-19 00:42:24 +00:00
|
|
|
Log the user out of a Docker Registry
|
2015-04-27 12:54:51 +00:00
|
|
|
See **docker-logout(1)** for full documentation on the **logout** command.
|
2014-06-27 06:52:36 +00:00
|
|
|
|
2015-04-27 12:54:51 +00:00
|
|
|
**logs**
|
2014-04-16 18:07:55 +00:00
|
|
|
Fetch the logs of a container
|
2015-04-27 12:54:51 +00:00
|
|
|
See **docker-logs(1)** for full documentation on the **logs** command.
|
2014-04-16 18:07:55 +00:00
|
|
|
|
2015-04-27 12:54:51 +00:00
|
|
|
**pause**
|
2014-07-01 02:58:04 +00:00
|
|
|
Pause all processes within a container
|
2015-04-27 12:54:51 +00:00
|
|
|
See **docker-pause(1)** for full documentation on the **pause** command.
|
2014-07-01 02:58:04 +00:00
|
|
|
|
2015-04-27 12:54:51 +00:00
|
|
|
**port**
|
2014-04-16 18:07:55 +00:00
|
|
|
Lookup the public-facing port which is NAT-ed to PRIVATE_PORT
|
2015-04-27 12:54:51 +00:00
|
|
|
See **docker-port(1)** for full documentation on the **port** command.
|
2014-04-16 18:07:55 +00:00
|
|
|
|
2015-04-27 12:54:51 +00:00
|
|
|
**ps**
|
2014-04-16 18:07:55 +00:00
|
|
|
List containers
|
2015-04-27 12:54:51 +00:00
|
|
|
See **docker-ps(1)** for full documentation on the **ps** command.
|
2014-04-16 18:07:55 +00:00
|
|
|
|
2015-04-27 12:54:51 +00:00
|
|
|
**pull**
|
2015-04-19 00:42:24 +00:00
|
|
|
Pull an image or a repository from a Docker Registry
|
2015-04-27 12:54:51 +00:00
|
|
|
See **docker-pull(1)** for full documentation on the **pull** command.
|
2014-04-16 18:07:55 +00:00
|
|
|
|
2015-04-27 12:54:51 +00:00
|
|
|
**push**
|
2015-04-19 00:42:24 +00:00
|
|
|
Push an image or a repository to a Docker Registry
|
2015-04-27 12:54:51 +00:00
|
|
|
See **docker-push(1)** for full documentation on the **push** command.
|
2014-04-16 18:07:55 +00:00
|
|
|
|
2015-08-03 16:36:37 +00:00
|
|
|
**rename**
|
|
|
|
Rename a container.
|
|
|
|
See **docker-rename(1)** for full documentation on the **rename** command.
|
|
|
|
|
2015-04-27 12:54:51 +00:00
|
|
|
**restart**
|
2015-09-09 10:27:41 +00:00
|
|
|
Restart a container
|
2015-04-27 12:54:51 +00:00
|
|
|
See **docker-restart(1)** for full documentation on the **restart** command.
|
2014-04-16 18:07:55 +00:00
|
|
|
|
2015-04-27 12:54:51 +00:00
|
|
|
**rm**
|
2014-04-16 18:07:55 +00:00
|
|
|
Remove one or more containers
|
2015-04-27 12:54:51 +00:00
|
|
|
See **docker-rm(1)** for full documentation on the **rm** command.
|
2014-04-16 18:07:55 +00:00
|
|
|
|
2015-04-27 12:54:51 +00:00
|
|
|
**rmi**
|
2014-04-16 18:07:55 +00:00
|
|
|
Remove one or more images
|
2015-04-27 12:54:51 +00:00
|
|
|
See **docker-rmi(1)** for full documentation on the **rmi** command.
|
2014-04-16 18:07:55 +00:00
|
|
|
|
2015-04-27 12:54:51 +00:00
|
|
|
**run**
|
2014-04-16 18:07:55 +00:00
|
|
|
Run a command in a new container
|
2015-04-27 12:54:51 +00:00
|
|
|
See **docker-run(1)** for full documentation on the **run** command.
|
2014-04-16 18:07:55 +00:00
|
|
|
|
2015-04-27 12:54:51 +00:00
|
|
|
**save**
|
2014-04-16 18:07:55 +00:00
|
|
|
Save an image to a tar archive
|
2015-04-27 12:54:51 +00:00
|
|
|
See **docker-save(1)** for full documentation on the **save** command.
|
2014-04-16 18:07:55 +00:00
|
|
|
|
2015-04-27 12:54:51 +00:00
|
|
|
**search**
|
2014-04-16 18:07:55 +00:00
|
|
|
Search for an image in the Docker index
|
2015-04-27 12:54:51 +00:00
|
|
|
See **docker-search(1)** for full documentation on the **search** command.
|
2014-04-16 18:07:55 +00:00
|
|
|
|
2015-04-27 12:54:51 +00:00
|
|
|
**start**
|
2015-10-03 15:56:41 +00:00
|
|
|
Start a container
|
2015-04-27 12:54:51 +00:00
|
|
|
See **docker-start(1)** for full documentation on the **start** command.
|
2014-04-16 18:07:55 +00:00
|
|
|
|
2015-04-27 12:54:51 +00:00
|
|
|
**stats**
|
2015-03-13 07:28:09 +00:00
|
|
|
Display a live stream of one or more containers' resource usage statistics
|
2015-04-27 12:54:51 +00:00
|
|
|
See **docker-stats(1)** for full documentation on the **stats** command.
|
2015-03-13 07:28:09 +00:00
|
|
|
|
2015-04-27 12:54:51 +00:00
|
|
|
**stop**
|
2015-10-03 15:56:41 +00:00
|
|
|
Stop a container
|
2015-04-27 12:54:51 +00:00
|
|
|
See **docker-stop(1)** for full documentation on the **stop** command.
|
2014-04-16 18:07:55 +00:00
|
|
|
|
2015-04-27 12:54:51 +00:00
|
|
|
**tag**
|
2014-04-16 18:07:55 +00:00
|
|
|
Tag an image into a repository
|
2015-04-27 12:54:51 +00:00
|
|
|
See **docker-tag(1)** for full documentation on the **tag** command.
|
2014-04-16 18:07:55 +00:00
|
|
|
|
2015-04-27 12:54:51 +00:00
|
|
|
**top**
|
2014-04-16 18:07:55 +00:00
|
|
|
Lookup the running processes of a container
|
2015-04-27 12:54:51 +00:00
|
|
|
See **docker-top(1)** for full documentation on the **top** command.
|
2014-04-16 18:07:55 +00:00
|
|
|
|
2015-04-27 12:54:51 +00:00
|
|
|
**unpause**
|
2014-07-01 02:58:04 +00:00
|
|
|
Unpause all processes within a container
|
2015-04-27 12:54:51 +00:00
|
|
|
See **docker-unpause(1)** for full documentation on the **unpause** command.
|
2014-07-01 02:58:04 +00:00
|
|
|
|
2015-04-27 12:54:51 +00:00
|
|
|
**version**
|
2014-04-16 18:07:55 +00:00
|
|
|
Show the Docker version information
|
2015-04-27 12:54:51 +00:00
|
|
|
See **docker-version(1)** for full documentation on the **version** command.
|
2014-04-16 18:07:55 +00:00
|
|
|
|
2015-04-27 12:54:51 +00:00
|
|
|
**wait**
|
2014-04-16 18:07:55 +00:00
|
|
|
Block until a container stops, then print its exit code
|
2015-04-27 12:54:51 +00:00
|
|
|
See **docker-wait(1)** for full documentation on the **wait** command.
|
2014-04-16 18:07:55 +00:00
|
|
|
|
2016-01-03 22:03:39 +00:00
|
|
|
|
2016-03-18 19:43:17 +00:00
|
|
|
# RUNTIME EXECUTION OPTIONS
|
2015-01-28 22:54:25 +00:00
|
|
|
|
2016-01-07 16:08:30 +00:00
|
|
|
Use the **--exec-opt** flags to specify options to the execution driver.
|
|
|
|
The following options are available:
|
2015-01-28 22:54:25 +00:00
|
|
|
|
|
|
|
#### native.cgroupdriver
|
2016-03-18 19:43:17 +00:00
|
|
|
Specifies the management of the container's `cgroups`. Only `cgroupfs` can be specified
|
|
|
|
`cgroupfs` at the moment.
|
2015-01-28 22:54:25 +00:00
|
|
|
|
2014-11-06 15:58:07 +00:00
|
|
|
#### Client
|
2014-11-21 00:36:37 +00:00
|
|
|
For specific client examples please see the man page for the specific Docker
|
|
|
|
command. For example:
|
2014-04-16 18:07:55 +00:00
|
|
|
|
2015-02-22 20:39:43 +00:00
|
|
|
man docker-run
|
2014-04-16 18:07:55 +00:00
|
|
|
|
|
|
|
# HISTORY
|
2014-11-06 15:58:07 +00:00
|
|
|
April 2014, Originally compiled by William Henry (whenry at redhat dot com) based on docker.com source material and internal work.
|