This table serves as a quick jump list for common docker commands.
Command | Description | Category |
---|---|---|
docker create | creates a container but does not start it. | Lifecycle |
docker rename | allows the container to be renamed. | Lifecycle |
docker run | creates and starts a container in one operation. | Lifecycle |
docker rm | deletes a container. | Lifecycle |
docker update | updates a container’s resource limits. | Lifecycle |
docker start | starts a container so it is running. | State |
docker stop | stops a running container. | State |
docker restart | stops and starts a container. | State |
docker pause | pauses a running container, “freezing” it in place. | State |
docker unpause | will unpause a running container. | State |
docker wait | blocks until running container stops. | State |
docker kill | sends a SIGKILL to a running container. | State |
docker attach | will connect to a running container. | State |
docker ps | shows running containers. | Info |
docker logs | gets logs from container. (You can use a custom log driver, but logs is only available for json-file and journald in 1.10). | Info |
docker inspect | looks at all the info on a container (including IP address). | Info |
docker events | gets events from container. | Info |
docker port | shows public facing port of container. | Info |
docker top | shows running processes in container. | Info |
docker stats | shows containers’ resource usage statistics. | Info |
docker diff | shows changed files in the container’s FS. | Info |
docker cp | copies files or folders between a container and the local filesystem. | Import / Export |
docker export | turns container filesystem into tarball archive stream to STDOUT. | Import / Export |
docker exec | to execute a command in container. | Execution |
docker images | shows all images. | Lifecycle |
docker import | creates an image from a tarball. | Lifecycle |
docker build | creates image from Dockerfile. | Lifecycle |
docker commit | creates image from a container, pausing it temporarily if it is running. | Lifecycle |
docker rmi | removes an image. | Lifecycle |
docker load | loads an image from a tar archive as STDIN, including images and tags (as of 0.7). | Lifecycle |
docker save | saves an image to a tar archive stream to STDOUT with all parent layers, tags & versions (as of 0.7). | Lifecycle |
docker history | shows history of image. | Info |
docker tag | tags an image to a name (local or registry). | Info |
*** Information in this table is credited to Will Sargent