Since Docker 1.13 (January 2017), Docker has some new canonical pruning subcommands (use with care):
-
docker image prune
-
docker container prune
-
docker volume prune
-
docker network prune
-
docker system prune
- all stopped containers
- all networks not used by at least one container
- all dangling images
- all build cache
However, Docker Desktop has had some sketchy upgrades that left things behind, which required manual file removal or “factory resets” for some folks.
- Manual Deletion
- Mac – https://github.com/docker/for-mac/issues/371 (This one got me a week or so ago. I resorted to pruning and deleting data with
rm -rf ~/Library/Containers/com.docker.docker/Data/*) - Win – https://github.com/docker/for-win/issues/745#issuecomment-319930974
- Mac – https://github.com/docker/for-mac/issues/371 (This one got me a week or so ago. I resorted to pruning and deleting data with
- Factory Reset In the Docker Preferences GUI, there is a “reset to factory defaults” option. (In Docker Desktop for Mac v3.3, the option is in the “troubleshoot” tab, the icon for which looks like a bug.
)