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.

Docker management commands

CommandDescription
dockerdLaunch the Docker daemon
infoDisplay system-wide information
inspectReturn low-level information on a container or image
versionShow the Docker version information

Image commands

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

Container commands

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

Hub and registry commands

CommandDescription
loginRegister or log in to a Docker registry
logoutLog out from a Docker registry
pullPull an image or a repository from a Docker registry
pushPush an image or a repository to a Docker registry
searchSearch the 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 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 all unused volumes
volume rmRemove one or more volumes

Swarm node commands

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

Swarm swarm commands

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

Swarm service commands

CommandDescription
service createCreate a new service
service inspectInspect a service
service lsList services in the swarm
service rmRemove a service from the swarm
service scaleSet the number of replicas for the desired state of the service
service psList the tasks of a 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 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 enbaleEnable 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