Add notes_on_docker_usage.md

This commit is contained in:
retoor 2024-12-11 16:35:59 +00:00
parent b74745df09
commit 65a0519ee7

39
notes_on_docker_usage.md Normal file
View File

@ -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
```