Complete Docker commands cheat sheet for container management, image operations, Docker Compose, and system administration. Essential reference for DevOps engineers and developers working with containerized applications.
Search all Docker shortcuts interactively
Interactive Shortcut Finder| Shortcut | Action | What it does |
|---|---|---|
| docker attach | Attach local standard input, output, and error streams to a running container | Alias of docker container attach. |
| docker commit | Create a new image from a container's changes | Alias of docker container commit. |
| docker cp | Copy files/folders between a container and the local filesystem | Alias of docker container cp. |
| docker create | Create a new container | Alias of docker container create. |
| docker diff | Inspect changes to files or directories on a container's filesystem | Alias of docker container diff. |
| docker exec | Execute a command in a running container | Alias of docker container exec. |
| docker export | Export a container's filesystem as a tar archive | Alias of docker container export. |
| docker kill | Kill one or more running containers | Alias of docker container kill. |
| docker logs | Fetch the logs of a container | Alias of docker container logs. |
| docker ps | List containers | Alias of docker container ls. |
| docker pause | Pause all processes within one or more containers | Alias of docker container pause. |
| docker port | List port mappings or a specific mapping for the container | Alias of docker container port. |
| docker rename | Rename a container | Alias of docker container rename. |
| docker restart | Restart one or more containers | Alias of docker container restart. |
| docker rm | Remove one or more containers | Alias of docker container rm. |
| docker run | Create and run a new container from an image | Alias of docker container run. |
| docker start | Start one or more stopped containers | Alias of docker container start. |
| docker stats | Display a live stream of container(s) resource usage statistics | Alias of docker container stats. |
| docker stop | Stop one or more running containers | Alias of docker container stop. |
| docker top | Display the running processes of a container | Alias of docker container top. |
| docker unpause | Unpause all processes within one or more containers | Alias of docker container unpause. |
| docker update | Update configuration of one or more containers | Alias of docker container update. |
| docker wait | Block until one or more containers stop, then print their exit codes | Alias of docker container wait. |
| docker build | Build an image from a Dockerfile | Alias of docker image build. |
| docker history | Show the history of an image | Alias of docker image history. |
| docker import | Import the contents from a tarball to create a filesystem image | Alias of docker image import. |
| docker load | Load an image from a tar archive or STDIN | Alias of docker image load. |
| docker images | List images | Alias of docker image ls. |
| docker pull | Download an image from a registry | Alias of docker image pull. |
| docker push | Upload an image to a registry | Alias of docker image push. |
| docker rmi | Remove one or more images | Alias of docker image rm. |
| docker save | Save one or more images to a tar archive (streamed to STDOUT by default) | Alias of docker image save. |
| docker tag | Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE | Alias of docker image tag. |
| Shortcut | Action | What it does |
|---|---|---|
| docker dhi | CLI for managing Docker Hardened Images | CLI for managing Docker Hardened Images. |
| docker inspect | Return low-level information on Docker objects | Return low-level information on Docker objects. |
| docker login | Authenticate to a registry | Authenticate to a registry. |
| docker logout | Log out from a registry | Log out from a registry. |
| docker pass | Manage your local OS keychain secrets. | Manage your local OS keychain secrets.. |
| docker search | Search Docker Hub for images | Search Docker Hub for images. |
| docker version | Show the Docker version information | Show the Docker version information. |
| Shortcut | Action | What it does |
|---|---|---|
| docker container attach | Attach local standard input, output, and error streams to a running container | Also available as docker attach. Attach local standard input, output, and error streams to a running container. |
| docker container commit | Create a new image from a container's changes | Also available as docker commit. Create a new image from a container's changes. |
| docker container cp | Copy files/folders between a container and the local filesystem | Also available as docker cp. Copy files/folders between a container and the local filesystem. |
| docker container create | Create a new container | Also available as docker create. Create a new container. |
| docker container diff | Inspect changes to files or directories on a container's filesystem | Also available as docker diff. Inspect changes to files or directories on a container's filesystem. |
| docker container exec | Execute a command in a running container | Also available as docker exec. Execute a command in a running container. |
| docker container export | Export a container's filesystem as a tar archive | Also available as docker export. Export a container's filesystem as a tar archive. |
| docker container inspect | Display detailed information on one or more containers | Display detailed information on one or more containers. |
| docker container kill | Kill one or more running containers | Also available as docker kill. Kill one or more running containers. |
| docker container logs | Fetch the logs of a container | Also available as docker logs. Fetch the logs of a container. |
| docker container ls | List containers | Also available as docker ps. List containers. |
| docker container pause | Pause all processes within one or more containers | Also available as docker pause. Pause all processes within one or more containers. |
| docker container port | List port mappings or a specific mapping for the container | Also available as docker port. List port mappings or a specific mapping for the container. |
| docker container prune | Remove all stopped containers | Remove all stopped containers. |
| docker container rename | Rename a container | Also available as docker rename. Rename a container. |
| docker container restart | Restart one or more containers | Also available as docker restart. Restart one or more containers. |
| docker container rm | Remove one or more containers | Also available as docker rm. Remove one or more containers. |
| docker container run | Create and run a new container from an image | Also available as docker run. Create and run a new container from an image. |
| docker container start | Start one or more stopped containers | Also available as docker start. Start one or more stopped containers. |
| docker container stats | Display a live stream of container(s) resource usage statistics | Also available as docker stats. Display a live stream of container(s) resource usage statistics. |
| docker container stop | Stop one or more running containers | Also available as docker stop. Stop one or more running containers. |
| docker container top | Display the running processes of a container | Also available as docker top. Display the running processes of a container. |
| docker container unpause | Unpause all processes within one or more containers | Also available as docker unpause. Unpause all processes within one or more containers. |
| docker container update | Update configuration of one or more containers | Also available as docker update. Update configuration of one or more containers. |
| docker container wait | Block until one or more containers stop, then print their exit codes | Also available as docker wait. Block until one or more containers stop, then print their exit codes. |
| Shortcut | Action | What it does |
|---|---|---|
| docker image build | Build an image from a Dockerfile | Also available as docker build. Build an image from a Dockerfile. |
| docker image history | Show the history of an image | Also available as docker history. Show the history of an image. |
| docker image import | Import the contents from a tarball to create a filesystem image | Also available as docker import. Import the contents from a tarball to create a filesystem image. |
| docker image inspect | Display detailed information on one or more images | Display detailed information on one or more images. |
| docker image load | Load an image from a tar archive or STDIN | Also available as docker load. Load an image from a tar archive or STDIN. |
| docker image ls | List images | Also available as docker images. List images. |
| docker image prune | Remove unused images | Remove unused images. |
| docker image pull | Download an image from a registry | Also available as docker pull. Download an image from a registry. |
| docker image push | Upload an image to a registry | Also available as docker push. Upload an image to a registry. |
| docker image rm | Remove one or more images | Also available as docker rmi. Remove one or more images. |
| docker image save | Save one or more images to a tar archive (streamed to STDOUT by default) | Also available as docker save. Save one or more images to a tar archive (streamed to STDOUT by default). |
| docker image tag | Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE | Also available as docker tag. Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE. |
| Shortcut | Action | What it does |
|---|---|---|
| docker network connect | Connect a container to a network | Connect a container to a network. |
| docker network create | Create a network | Create a network. |
| docker network disconnect | Disconnect a container from a network | Disconnect a container from a network. |
| docker network inspect | Display detailed information on one or more networks | Display detailed information on one or more networks. |
| docker network ls | List networks | List networks. |
| docker network prune | Remove all unused networks | Remove all unused networks. |
| docker network rm | Remove one or more networks | Remove one or more networks. |
| Shortcut | Action | What it does |
|---|---|---|
| docker volume create | Create a volume | Create a volume. |
| docker volume inspect | Display detailed information on one or more volumes | Display detailed information on one or more volumes. |
| docker volume ls | List volumes | List volumes. |
| docker volume prune | Remove unused local volumes | Remove unused local volumes. |
| docker volume rm | Remove one or more volumes | Remove one or more volumes. |
| docker volume update | Update a volume (cluster volumes only) | Update a volume (cluster volumes only). |
| Shortcut | Action | What it does |
|---|---|---|
| docker compose alpha dry-run | EXPERIMENTAL - Dry run command allow you to test a command without applying changes | EXPERIMENTAL - Dry run command allow you to test a command without applying changes. |
| docker compose alpha scale | Scale services | Scale services. |
| docker compose alpha watch | Watch build context for service and rebuild/refresh containers when files are updated | Watch build context for service and rebuild/refresh containers when files are updated. |
| docker compose attach | Attach local standard input, output, and error streams to a service's running container | Attach local standard input, output, and error streams to a service's running container. |
| docker compose bridge | Convert compose files into another model | Convert compose files into another model. |
| docker compose build | Build or rebuild services | Build or rebuild services. |
| docker compose commit | Create a new image from a service container's changes | Create a new image from a service container's changes. |
| docker compose config | Parse, resolve and render compose file in canonical format | Parse, resolve and render compose file in canonical format. |
| docker compose convert | Converts the compose file to platform's canonical format | Converts the compose file to platform's canonical format. |
| docker compose cp | Copy files/folders between a service container and the local filesystem | Copy files/folders between a service container and the local filesystem. |
| docker compose create | Creates containers for a service | Creates containers for a service. |
| docker compose down | Stop and remove containers, networks | Stop and remove containers, networks. |
| docker compose events | Receive real time events from containers | Receive real time events from containers. |
| docker compose exec | Execute a command in a running container | Execute a command in a running container. |
| docker compose export | Export a service container's filesystem as a tar archive | Export a service container's filesystem as a tar archive. |
| docker compose images | List images used by the created containers | List images used by the created containers. |
| docker compose kill | Force stop service containers | Force stop service containers. |
| docker compose logs | View output from containers | View output from containers. |
| docker compose ls | List running compose projects | List running compose projects. |
| docker compose pause | Pause services | Pause services. |
| docker compose port | Print the public port for a port binding | Print the public port for a port binding. |
| docker compose ps | List containers | List containers. |
| docker compose publish | Publish compose application | Publish compose application. |
| docker compose pull | Pull service images | Pull service images. |
| docker compose push | Push service images | Push service images. |
| docker compose restart | Restart service containers | Restart service containers. |
| docker compose rm | Removes stopped service containers | Removes stopped service containers. |
| docker compose run | Run a one-off command on a service | Run a one-off command on a service. |
| docker compose scale | Scale services | Scale services. |
| docker compose start | Start services | Start services. |
| docker compose stats | Display a live stream of container(s) resource usage statistics | Display a live stream of container(s) resource usage statistics. |
| docker compose stop | Stop services | Stop services. |
| docker compose top | Display the running processes | Display the running processes. |
| docker compose unpause | Unpause services | Unpause services. |
| docker compose up | Create and start containers | Create and start containers. |
| docker compose version | Show the Docker Compose version information | Show the Docker Compose version information. |
| docker compose volumes | List volumes | List volumes. |
| docker compose wait | Block until containers of all (or specified) services stop. | Block until containers of all (or specified) services stop.. |
| docker compose watch | Watch build context for service and rebuild/refresh containers when files are updated | Watch build context for service and rebuild/refresh containers when files are updated. |
| Shortcut | Action | What it does |
|---|---|---|
| docker system df | Show docker disk usage | Show docker disk usage. |
| docker system events | Get real time events from the server | Get real time events from the server. |
| docker system info | Display system-wide information | Display system-wide information. |
| docker system prune | Remove unused data | Remove unused data. |
| Shortcut | Action | What it does |
|---|---|---|
| docker context create | Create a context | Create a context. |
| docker context export | Export a context to a tar archive FILE or a tar stream on STDOUT. | Export a context to a tar archive FILE or a tar stream on STDOUT.. |
| docker context import | Import a context from a tar or zip file | Import a context from a tar or zip file. |
| docker context inspect | Display detailed information on one or more contexts | Display detailed information on one or more contexts. |
| docker context ls | List contexts | List contexts. |
| docker context rm | Remove one or more contexts | Remove one or more contexts. |
| docker context show | Print the name of the current context | Print the name of the current context. |
| docker context update | Update a context | Update a context. |
| docker context use | Set the default docker context | Set the default docker context. |
| Shortcut | Action | What it does |
|---|---|---|
| docker buildx bake | Build from a file | Build from a file. |
| docker buildx build | Start a build | Start a build. |
| docker buildx create | Create a new builder instance | Create a new builder instance. |
| docker buildx dap | Start debug adapter protocol compatible debugger | Start debug adapter protocol compatible debugger. |
| docker buildx debug | Start debugger | Start debugger. |
| docker buildx dial-stdio | Proxy current stdio streams to builder instance | Proxy current stdio streams to builder instance. |
| docker buildx du | Disk usage | Disk usage. |
| docker buildx history | Commands to work on build records | Commands to work on build records. |
| docker buildx imagetools | Commands to work on images in registry | Commands to work on images in registry. |
| docker buildx inspect | Inspect current builder instance | Inspect current builder instance. |
| docker buildx ls | List builder instances | List builder instances. |
| docker buildx policy | Commands for working with build policies | Commands for working with build policies. |
| docker buildx prune | Remove build cache | Remove build cache. |
| docker buildx rm | Remove one or more builder instances | Remove one or more builder instances. |
| docker buildx stop | Stop builder instance | Stop builder instance. |
| docker buildx use | Set the current builder instance | Set the current builder instance. |
| docker buildx version | Show buildx version information | Show buildx version information. |
Browse shortcuts for 268 platforms
Explore AllMost Docker days are run, ps, logs, exec. docker run creates and starts a container from an image; docker ps shows what's running and -a adds the stopped ones — which matters because a crashed container disappears from plain ps and beginners conclude it never started. docker logs -f follows output, and docker exec -it <id> bash drops you inside a running container (swap sh for minimal images that lack bash).
Since Compose v2 the command is docker compose — a space, not the old hyphenated docker-compose binary. up -d starts the stack detached, logs -f tails every service together, and down stops and removes containers and networks (volumes survive unless you add -v). The pairing worth internalizing: edit a Dockerfile → docker compose build → up -d recreates only what changed.
Docker hoards: stopped containers, dangling images, and build cache accumulate for weeks until the disk fills. docker system prune clears stopped containers, unused networks, and dangling images in one shot — but read its prompt before confirming, and know that adding -a also removes every image not used by a running container, which means long re-pulls later. docker stats and docker volume ls answer the two questions that precede most cleanups: what's eating resources, and what data would I lose?
run creates a new container from an image and starts it; exec runs an extra process (usually a shell) inside a container that's already running.
Plain ps lists running containers only. If it exited or crashed, docker ps -a shows it with its exit status, and docker logs <id> shows why.
docker compose (space) is the current v2 syntax built into the CLI. The hyphenated docker-compose is the legacy v1 binary; commands are otherwise near-identical.
It removes containers and networks but keeps named volumes. Add -v only when you deliberately want volumes gone too.
It only removes stopped containers, unused networks, and dangling images — running workloads are untouched. The riskier variant is prune -a, which also deletes all unused images.
Open your assistant with this page preloaded as the source — great for follow-up questions like "which of these work in other apps?"