diff --git a/notes_on_docker_usage.md b/notes_on_docker_usage.md new file mode 100644 index 0000000..727e332 --- /dev/null +++ b/notes_on_docker_usage.md @@ -0,0 +1,39 @@ +# Notes on docker + +Docker uses a lot of system resources without your knowledge. +This notes describe how to find out and what to do about it. + +## Find out space used by docker: +``` +sudo docker system df +``` +and +``` +sudo du -sh /var/lib/docker/ +``` + +## What to do about it? + +### 1. Remove unused layers (very effective) +``` +sudo docker system prune +``` +### 2. Remove unused images +``` +sudo docker image prune -a +``` +### 3. Clear out unused volume data +``` +sudo docker volume prune +``` + +### 4. Clear out builder cache +``` +sudo docker builder prune +``` + +### 5. Remove unused containers: +``` +sudo docker container prune +``` +