DockerCLI/docs/reference/commandline/index.md

14 KiB

title description keywords identifier
Docker commands Docker's CLI command description and usage Docker, Docker documentation, CLI, command line 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

Command Description
dockerd Launch the Docker daemon
inspect Return low-level information on a container or image
system events Get real-time events from the server
system info Display system-wide information
version Show the Docker version information

Image commands

Command Description
image build Build an image from a Dockerfile
image commit Create a new image from a container's changes
image history Show the history of an image
image import Import the contents from a tarball to create a filesystem image
image load Load an image from a tar archive or STDIN
image ls List images
image prune Remove unused images
image rm Remove one or more images
image save Save images to a tar archive
image tag Tag an image into a repository

Container commands

Command Description
container attach Attach to a running container
container cp Copy files/folders from a container to a HOSTDIR or to STDOUT
container create Create a new container
container diff Inspect changes on a container's filesystem
container exec Execute a command in a running container
container export Export a container's filesystem as a tar archive
container kill Kill a running container
container logs Fetch the logs of a container
container ls List containers
container pause Pause all processes within a container
container port List port mappings or a specific mapping for the container
container prune Remove all stopped containers
container rename Rename a container
container restart Restart a running container
container rm Remove one or more containers
container run Create and run a new container from an image
container start Start one or more stopped containers
container stats Display a live stream of container(s) resource usage statistics
container stop Stop a running container
container top Display the running processes of a container
container unpause Unpause all processes within a container
container update Update configuration of one or more containers
container wait Block until a container stops, then print its exit code

Hub and registry commands

Command Description
login Log in to a registry
logout Log out from a registry
pull Download an image from a registry
push Upload an image to a registry
search Search Docker Hub for images

Network and connectivity commands

Command Description
network connect Connect a container to a network
network create Create a new network
network disconnect Disconnect a container from a network
network inspect Display information about a network
network ls Lists all the networks the Engine daemon knows about
network prune Remove all unused networks
network rm Removes one or more networks

Shared data volume commands

Command Description
volume create Creates a new volume where containers can consume and store data
volume inspect Display information about a volume
volume ls Lists all the volumes Docker knows about
volume prune Remove unused local volumes
volume rm Remove one or more volumes

Swarm node commands

Command Description
node demote Demotes an existing manager so that it is no longer a manager
node inspect Inspect a node in the swarm
node ls List nodes in the swarm
node promote Promote a node that is pending a promotion to manager
node ps List tasks running on one or more nodes
node rm Remove one or more nodes from the swarm
node update Update attributes for a node

Swarm management commands

Command Description
swarm init Initialize a swarm
swarm join-token Display or rotate join tokens
swarm join Join a swarm as a manager node or worker node
swarm leave Remove the current node from the swarm
swarm unlock-key Manage the unlock key
swarm unlock Unlock swarm
swarm update Update attributes of a swarm

Swarm service commands

Command Description
service create Create a new service
service inspect Inspect a service
service logs Fetch the logs of a service or task
service ls List services in the swarm
service ps List the tasks of a service
service rm Remove a service from the swarm
service scale Set the number of replicas for the desired state of the service
service update Update the attributes of a service

Swarm secret commands

Command Description
secret create Create a secret from a file or STDIN as content
secret inspect Inspect the specified secret
secret ls List secrets in the swarm
secret rm Remove the specified secrets from the swarm

Swarm stack commands

Command Description
stack config Output the Compose file after merges and interpolations
stack deploy Deploy a new stack or update an existing stack
stack ls List stacks in the swarm
stack ps List the tasks in the stack
stack rm Remove the stack from the swarm
stack services List the services in the stack

Plugin commands

Command Description
plugin create Create a plugin from a rootfs and configuration
plugin disable Disable a plugin
plugin enable Enable a plugin
plugin inspect Display detailed information on a plugin
plugin install Install a plugin
plugin ls List plugins
plugin push Push a plugin to a registry
plugin rm Remove a plugin
plugin set Change settings for a plugin

Context commands

Command Description
context create Create a context
context export Export a context
context import Import a context
context inspect Inspect one or more contexts
context ls List contexts
context rm Remove one or more contexts
context update Update a context
context use Set the current docker context