docker - Man Page
Docker image and container command line interface
Examples (TL;DR)
- List all Docker containers (running and stopped):
docker ps --all
- Start a container from an image, with a custom name:
docker run --name container_name image
- Start or stop an existing container:
docker start|stop container_name
- Pull an image from a Docker registry:
docker pull image
- Display the list of already downloaded images:
docker images
- Open an [i]nteractive [t]ty with Bourne shell (
sh
) inside a running container:docker exec -it container_name sh
- Remove a stopped container:
docker rm container_name
- Fetch and follow the logs of a container:
docker logs -f container_name
Synopsis
docker [Options] COMMAND [ARG...]
Description
docker is a client for interacting with the daemon (see dockerd(8)) through the CLI.
The Docker CLI has over 30 commands. The commands are listed below and each has its own man page which explains usage and arguments.
To see the man page for a command run man docker .
Options
- --help
Print usage statement
- --config=""
Specifies the location of the Docker client configuration files. The default is '~/.docker'.
- -D, --debug=true|false
Enable debug mode. Default is false.
- -H, --host=[unix:///var/run/docker.sock]: tcp://[host]:[port][path] 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/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.- -l, --log-level="debug|info|warn|error|fatal"
Set the logging level. Default is info.
- --tls=true|false
Use TLS; implied by --tlsverify. Default is false.
- --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
Use TLS and verify the remote (daemon: verify client, client: verify daemon).
Default is false.- -v, --version=true|false
Print version information and quit. Default is false.
Commands
Use "docker help" or "docker --help" to get an overview of available commands.
Examples
For specific client examples see the man page for the specific Docker command. For example:
man docker-run
History
April 2014, Originally compiled by William Henry (whenry at redhat dot com) based on docker.com source material and internal work.
Referenced By
Containerfile(5), docker-attach(1), docker-builder(1), docker-checkpoint(1), docker-commit(1), docker-config(1), docker-container(1), docker-container-attach(1), docker-context(1), docker-cp(1), docker-create(1), docker-diff(1), docker-events(1), docker-exec(1), docker-export(1), docker-history(1), docker-image(1), docker-images(1), docker-import(1), docker-info(1), docker-inspect(1), docker-kill(1), docker-load(1), docker-login(1), docker-logout(1), docker-logs(1), docker-manifest(1), docker-network(1), docker-node(1), docker-pause(1), docker-plugin(1), docker-port(1), docker-ps(1), docker-pull(1), docker-push(1), docker-rename(1), docker-restart(1), docker-rm(1), docker-rmi(1), docker-save(1), docker-search(1), docker-secret(1), docker-service(1), docker-stack(1), docker-start(1), docker-stats(1), docker-stop(1), docker-swarm(1), docker-system(1), docker-tag(1), docker-top(1), docker-trust(1), docker-unpause(1), docker-update(1), docker-version(1), docker-volume(1), docker-wait(1), pmdadocker(1), scrun(1).