Docker - Useful Commands
???? ?? ???? ??? ??????? ??????? ??????? ?????? docker ???? ????? ??? ??????? ??????? ??? docker ???? ?????? ?????? ????? ??? ??? ???? ??????? ????:
I decided to write this quick small list of docker commands that include some of useful commands about docker that I know and also I think you must know
To print system info about docker:
docker system info
To know the disk usage by docker:
docker system df
To know the detailed usage of disk by docker:
docker system df --verbose
To remove volumes related to containers when compose down:?
docker compose down --volumes
To clear all dangling images:
docker image prune?
To clear all dangling images - long version 1:
docker rmi `docker images -q -f dangling=true`?
To clear all dangling images - long version 2:
docker rmi $(docker images -q -f dangling=true)
To clear all dangling volumes:
docker volume prune
To clear all dangling volumes - long version 1:
docker volume rm $(docker volume ls -q -f dangling=true)?
领英推荐
To clear all dangling volumes - long version 2:
docker volume rm `docker volume ls -q -f dangling=true`
To clear all dangling images and dangling build cache and not used networks and stopped containers:?
docker system prune
To clear all dangling images and dangling build cache and not used networks and stopped containers and also dangling volumes:
docker system prune --volumes
To listen to docker system events:
docker system events
To filter events by date:?
docker system events --since '2022-12-30'
To filter events by date and time:
docker system events --since '2022-12-30T22:10:00'
To filter events by duration and format the output to json:
docker system events --since '30m' --format '{{json .}}'
Last, this is just a small set of useful docker commands I know, and the docker documentation is very powerful and you must read it to be a strong engineer when using docker for containerization: