Official docker installation script :
curl -fsSL https://get.docker.com/ | sh |
Stop all running container :
docker stop $(docker ps -a -q) |
Remove all containers :
docker rm $(docker ps -a -q) |
You can add -f param to force delete all containers
Remove all images
docker rmi $(docker images -q) |
You can add -f param to force delete all images, too
Remove all images without tag
docker rmi $(docker images | grep "^<none>" | awk "{print $3}") |
Remove all volumes
docker volume rm $(docker volume ls -qf dangling=true) |
Show latest started container
docker ps -l |
-l
display only one container-n
display X latest containers
Show container logs
docker logs -f <CONTAINER_ID|CONTAINER_NAME> |
-f
param to follow the upcoming log messages. When you are done, hit CTRL+C-t
param display timestamp
Show container stats
docker stats [CONTAINER_ID|CONTAINER_NAME] |
Without options, stats display all running containers
-a
,--all
display all containers
Enter in a container
docker exec -it [CONTAINER_ID|CONTAINER_NAME] bash |
Docker 直接對應 app 的指令懶人包
# Docker Alias |