An open API service indexing awesome lists of open source software.

https://github.com/vladwa/docker-cleanup-script

Docker cleanup shell script.
https://github.com/vladwa/docker-cleanup-script

docker shell-script

Last synced: 9 months ago
JSON representation

Docker cleanup shell script.

Awesome Lists containing this project

README

          

#Docker Cleanup script:
================================================================================

1. Delete docker Images with "" as a tag name.
- Command : ```docker rmi -f $(docker images | grep -w "" | awk {print $3})```

2. Delete "Dead" or "Exited" containers.
- Command : ```docker rm $(docker ps -a | grep "Dead\|Exited" | awk '{print $1}')```

3. Delete dangling docker images.
- Command : ``docker rmi -f $(docker images -qf dangling=true)```

4. Delete docker images older then one month.
- Command : ```docker rmi -f $(docker images | awk '{print $3,$4,$5}' | grep '[5-9]\{1\}\ weeks\|years\|months' | awk '{print $1}')```

5. Delete or clean up unused docker volumes.
- Command : ```docker rmi -f $(docker volume ls -qf dangling=true)```