navi: Add some cheat sheets

This commit is contained in:
2020-11-21 10:07:54 +01:00
parent 65e03c4990
commit 2655c4559b
5 changed files with 161 additions and 0 deletions

39
navi/docker.cheat Normal file
View File

@@ -0,0 +1,39 @@
% docker-volumes
# Create a volume
sudo docker volume create <name>
# List all volumes
sudo docker volume ls
# Remove volume
sudo docker volume rm <volume>
$ volume: sudo docker volume ls --format "{{.Name}}" | awk '{print $1}'
% docker-network
# Create new network
docker network create <name>
# List the networks
sudo docker network ls
% docker
# List the running containers
sudo docker ps
# Stop a running container through SIGTERM
sudo docker stop <container_id>
# Stop a running container through SIGKILL
sudo docker kill <container_id>
# Print the last lines of a container's logs
docker logs --tail 100 <container_id> | less
# Print the last lines of a container's logs and following its logs
docker logs --tail 100 <container_id> -f
$ container_id: sudo docker ps --format "{{.ID}}" | awk '{print $1}'