Cheat Sheet
Notes from Docker & Kubernetes: The Paractice Guide [2022] By Maximilian Schwarzmüller
Containers
List containers
| N/A | By default, it list all running containers. The |
Start and Run containers
|
| Make a container up and running. With start we will be unable to interact with it and see the logs. |
|
| Make a container running in the foreground. Does not allow us to interact with the terminal anymore. |
Stop and Remove containers
N/A | Stop all running containers at once | |
| N/A | Remove all stopped containers |
| N/A | Remove containers. Containers need to be stopped before deleting. |
Copy files from and to containers
| N/A | Copy files and directories from and to containers to local system. We can copy the entire content of a folder doing |
Execute commands inside the container
| Allows to execute commands inside of a container without interrupting the main process | |
Images
Build an image
|
| Build the image and use the Dockerfile at the current location. |
List images
| List all existing images |
Remove images
| N/A | Remove an image |
| N/A | Remove all unused images |
Inspect images
| Shows the configurations of an image. We can also inspect all the layers of an image. |
Rename images
| When we rename an image we do a clone of the old image. |
Push an image
| Push an image on DockerHub. We need to login before pushing an image with |
Pull an image
| Pull an image from DockerHub |
Volumes
| List existing volumes | |
| Delete a one volume | |
| Delete all volumes | |
| The container directory correspond to the path inside the container where the data we want to save is located | Use an existing volume |
Create volume
| Create an Anonymous volume | |
| Create a Named volume | |
| Create a bind mount | |
| Create a volume manually with docker volume command |
Network
| List all existing networks | |
| Create a new network | |
Last updated