DockerCLI/docs/reference/commandline/docker.md

9.0 KiB

docker

The base command for the Docker CLI.

Subcommands

Name Description
attach Attach local standard input, output, and error streams to a running container
build Build an image from a Dockerfile
builder Manage builds
checkpoint Manage checkpoints
commit Create a new image from a container's changes
config Manage Swarm configs
container Manage containers
context Manage contexts
cp Copy files/folders between a container and the local filesystem
create Create a new container
diff Inspect changes to files or directories on a container's filesystem
events Get real time events from the server
exec Execute a command in a running container
export Export a container's filesystem as a tar archive
history Show the history of an image
image Manage images
images List images
import Import the contents from a tarball to create a filesystem image
info Display system-wide information
inspect Return low-level information on Docker objects
kill Kill one or more running containers
load Load an image from a tar archive or STDIN
login Log in to a registry
logout Log out from a registry
logs Fetch the logs of a container
manifest Manage Docker image manifests and manifest lists
network Manage networks
node Manage Swarm nodes
pause Pause all processes within one or more containers
plugin Manage plugins
port List port mappings or a specific mapping for the container
ps List containers
pull Download an image from a registry
push Upload an image to a registry
rename Rename a container
restart Restart one or more containers
rm Remove one or more containers
rmi Remove one or more images
run Create and run a new container from an image
save Save one or more images to a tar archive (streamed to STDOUT by default)
search Search Docker Hub for images
secret Manage Swarm secrets
service Manage Swarm services
stack Manage Swarm stacks
start Start one or more stopped containers
stats Display a live stream of container(s) resource usage statistics
stop Stop one or more running containers
swarm Manage Swarm
system Manage Docker
tag Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
top Display the running processes of a container
trust Manage trust on Docker images
unpause Unpause all processes within one or more containers
update Update configuration of one or more containers
version Show the Docker version information
volume Manage volumes
wait Block until one or more containers stop, then print their exit codes

Options

Name Type Default Description
--config string /root/.docker Location of client config files
-c, --context string Name of the context to use to connect to the daemon (overrides DOCKER_HOST env var and default context set with docker context use)
-D, --debug Enable debug mode
-H, --host list Daemon socket to connect to
-l, --log-level string info Set the logging level (debug, info, warn, error, fatal)
--tls Use TLS; implied by --tlsverify
--tlscacert string /root/.docker/ca.pem Trust certs signed only by this CA
--tlscert string /root/.docker/cert.pem Path to TLS certificate file
--tlskey string /root/.docker/key.pem Path to TLS key file
--tlsverify Use TLS and verify the remote