Docker cheatsheet -

Basic Commands
Build an image from a Dockerfile
docker info
Display Docker system-wide information
docker ps
List of running containers
docker ps -a
show all containers
docker ps -l
Show the latest created container (includes all states)
docker pull <image_name>:<tag>
Pulls the image from the repository
docker push <image_name>:<tag>
Push the image to the repository
Container Commands
docker inspect <container id/name>
Inspect the container
docker logs <container id/name>
Retrieves the logs of a container
docker kill <container id/name>
Kill a running container
docker pause <container id/name>
Suspends all the processes in the running container
docker port <container id/name>
Lists the port mappings for the container
docker restart <container id/name>
Restarts the container
docker rm <container id/name>
Removes the container
docker run <container id/name>
Run a command in a new container
Start a stoped container
docker stats <container id/name>
Display a live stream of container(s) resource usage statistics
Stop one or more running containers
docker unpause <container id/name>
Un-pause all processes within one or more containers
Image Commands
Create a new container based image
List images
docker rmi <image>
Remove images
Run a command in an image
docker save <image>
Save images to a tar archive
Network Commands
docker network create <network>
Create a network
docker network connect <network> <container>
Connect a container to a network
docker network connect --ip <ip> <network> <container>
Connect a container to a network,Specify the ip address of container interface
docker network disconnect <network> <container>
Disconnect a container from a network
docker network ls
List networks
docker network inspect <network>
Display detailed information for networks
docker network rm <network>
Remove one or more networks
Volume Commands
docker volume create
Create a volume
docker volume inspect <volume>
Display detailed information on one or more volumes
docker volume ls
List volumes
docker volume rm <volume>
Remove volumes
Misc Commands
docker cp <container>:<source_path> <dest_path>
Copy files/folders specified by source_path from container to the local filesystem
docker cp <source_path> <container>:<dest_path>
Copy files/folders specified by source_path from local filesystem to the container
Run a command in a running container