Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker for Windows cleanup

Tags:

docker

I'm using docker for Windows to launch a MSSQL server. Everything is working fine except for the fact that my harddrive is now full. I've used all the cleanup commands that docker has, removing all images and containers:

docker kill $(docker ps -q) docker rm $(docker ps -a -q) docker rmi $(docker images -q -f dangling=true) docker rmi $(docker images -q) 

This will not remove any contents in the c:\ProgramData\Docker\windowsfilter folder, where there are still a lot of file. Roughly 130gb worth's of storage, without any running containers or stored images.

Client:  Version:      17.03.1-ce  API version:  1.27  Go version:   go1.7.5  Git commit:   c6d412e  Built:        Tue Mar 28 00:40:02 2017  OS/Arch:      windows/amd64  Server:  Version:      17.03.1-ce  API version:  1.27 (minimum version 1.24)  Go version:   go1.7.5  Git commit:   c6d412e  Built:        Tue Mar 28 00:40:02 2017  OS/Arch:      windows/amd64  Experimental: true 

I tried to use the docker-ci-zap (https://github.com/jhowardmsft/docker-ci-zap) , but running that tool is not recommended so I would rather use an alternative solution

like image 336
imacbest Avatar asked Apr 24 '17 13:04

imacbest


People also ask

How do I clean up all docker images?

Remove all images All the Docker images on a system can be listed by adding -a to the docker images command. Once you're sure you want to delete them all, you can add the -q flag to pass the image ID to docker rmi : List: docker images -a.


1 Answers

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
  • 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. enter image description here)
like image 140
Jamie Jackson Avatar answered Oct 12 '22 14:10

Jamie Jackson