datamade / how-to

📚 Doing all sorts of things, the DataMade way

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

useful docker commands for reclaiming space

derekeder opened this issue · comments

Documentation request

Sometimes docker behaves weirdly and fails to build / restarts suddenly. This is typically because it ran out of hard drive space. We should document some helpful commands to reclaim space in docker. This stack overflow thread has some really helpful ones:

Delete the orphaned volumes in Docker

docker volume rm $(docker volume ls -qf dangling=true)

List dangling volumes:

docker volume ls -qf dangling=true

List all volumes:

docker volume ls

Delete unused images

Remove <none> images that sometimes get generated when a Docker build is interrupted and then hang around:

docker rmi $(docker images | grep '^<none>' | awk '{print $3}')