title: “Docker commands” description: “Docker's CLI command description and usage” keywords: “Docker, Docker documentation, CLI, command line” identifier: “smn_cli_guide”

The Docker commands

This section contains reference information on using Docker's command line client. Each command has a reference page along with samples. If you are unfamiliar with the command line, you should start by reading about how to Use the Docker command line.

You start the Docker daemon with the command line. How you start the daemon affects your Docker containers. For that reason you should also make sure to read the dockerd reference page.

Commands by object

Docker management commands

CommandDescription
dockerdLaunch the Docker daemon
inspectReturn low-level information on a container or image
system eventsGet real-time events from the server
system infoDisplay system-wide information
versionShow the Docker version information

Image commands

CommandDescription
image buildBuild an image from a Dockerfile
image commitCreate a new image from a container's changes
image historyShow the history of an image
image importImport the contents from a tarball to create a filesystem image
image loadLoad an image from a tar archive or STDIN
image lsList images
image pruneRemove unused images
image rmRemove one or more images
image saveSave images to a tar archive
image tagTag an image into a repository

Container commands

CommandDescription
container attachAttach to a running container
container cpCopy files/folders from a container to a HOSTDIR or to STDOUT
container createCreate a new container
container diffInspect changes on a container's filesystem
container execExecute a command in a running container
container exportExport a container's filesystem as a tar archive
container killKill a running container
container logsFetch the logs of a container
container lsList containers
container pausePause all processes within a container
container portList port mappings or a specific mapping for the container
container pruneRemove all stopped containers
container renameRename a container
container restartRestart a running container
container rmRemove one or more containers
container runCreate and run a new container from an image
container startStart one or more stopped containers
container statsDisplay a live stream of container(s) resource usage statistics
container stopStop a running container
container topDisplay the running processes of a container
container unpauseUnpause all processes within a container
container updateUpdate configuration of one or more containers
container waitBlock until a container stops, then print its exit code

Hub and registry commands

CommandDescription
loginLog in to a registry
logoutLog out from a registry
pullDownload an image from a registry
pushUpload an image to a registry
searchSearch Docker Hub for images

Network and connectivity commands

CommandDescription
network connectConnect a container to a network
network createCreate a new network
network disconnectDisconnect a container from a network
network inspectDisplay information about a network
network lsLists all the networks the Engine daemon knows about
network pruneRemove all unused networks
network rmRemoves one or more networks

Shared data volume commands

CommandDescription
volume createCreates a new volume where containers can consume and store data
volume inspectDisplay information about a volume
volume lsLists all the volumes Docker knows about
volume pruneRemove unused local volumes
volume rmRemove one or more volumes

Swarm node commands

CommandDescription
node demoteDemotes an existing manager so that it is no longer a manager
node inspectInspect a node in the swarm
node lsList nodes in the swarm
node promotePromote a node that is pending a promotion to manager
node psList tasks running on one or more nodes
node rmRemove one or more nodes from the swarm
node updateUpdate attributes for a node

Swarm management commands

CommandDescription
swarm initInitialize a swarm
swarm join-tokenDisplay or rotate join tokens
swarm joinJoin a swarm as a manager node or worker node
swarm leaveRemove the current node from the swarm
swarm unlock-keyManage the unlock key
swarm unlockUnlock swarm
swarm updateUpdate attributes of a swarm

Swarm service commands

CommandDescription
service createCreate a new service
service inspectInspect a service
service logsFetch the logs of a service or task
service lsList services in the swarm
service psList the tasks of a service
service rmRemove a service from the swarm
service scaleSet the number of replicas for the desired state of the service
service updateUpdate the attributes of a service

Swarm secret commands

CommandDescription
secret createCreate a secret from a file or STDIN as content
secret inspectInspect the specified secret
secret lsList secrets in the swarm
secret rmRemove the specified secrets from the swarm

Swarm stack commands

CommandDescription
stack configOutput the Compose file after merges and interpolations
stack deployDeploy a new stack or update an existing stack
stack lsList stacks in the swarm
stack psList the tasks in the stack
stack rmRemove the stack from the swarm
stack servicesList the services in the stack

Plugin commands

CommandDescription
plugin createCreate a plugin from a rootfs and configuration
plugin disableDisable a plugin
plugin enableEnable a plugin
plugin inspectDisplay detailed information on a plugin
plugin installInstall a plugin
plugin lsList plugins
plugin pushPush a plugin to a registry
plugin rmRemove a plugin
plugin setChange settings for a plugin

Context commands

CommandDescription
context createCreate a context
context exportExport a context
context importImport a context
context inspectInspect one or more contexts
context lsList contexts
context rmRemove one or more contexts
context updateUpdate a context
context useSet the current docker context