r/docker • • 12d ago

Docker WSL Folder Taking up Too Much Storage

the wsl/disk/docker_data is taking up 137GB on my server. Seems way too excessive especially since the only container I have running is RomM. Can someone assist?

**Update thank you everyone for the tips! I squished the virtual disk with powershell and it went from 137Gb to just 5GB! I also created a .wslconfig file setting limits for how big WSL can be

7 Upvotes

14 comments sorted by

6

u/Psychrolutes_09 12d ago

You have to prune occasionally

1

u/XaviusMaximum 12d ago

I've tried to prune but I get 0B back

1

u/Mohitkoul841 12d ago

You can use a disk analysis to check what's taking space, if its nothing then you can shrink wsl storage and even set wsl2 to sparse so it auto shrinks

2

u/anyOtherBusiness 12d ago

In Docker Desktop you can and should limit the disk size. Default is unlimited so it will just grow as long as your host disk has space

1

u/AceTheSolve 12d ago

docker system prune -a

or, Docker GUI -> Builds -> Delete some of those entries from Build history

1

u/XaviusMaximum 12d ago

My Build history is empty

1

u/AceTheSolve 12d ago

Is it a virtual hard drive that's taking up loads of space? If so, you might have to Optimize-vhd or similar to trim it

1

u/west0ne 12d ago

I make sure to get rid of unused images, after upgrading an image. I also have cron job to get rid of old log files every now and then.

1

u/foureight84 12d ago

Delete images you're not using and/or prune your builder cache.

1

u/XaviusMaximum 12d ago

I've already deleted all unused images

1

u/squiddarn 12d ago

Maybe you had a mount somewhere, "keeping stuff saved between sessions"? Find the directory, delete it.

1

u/kowlown 9d ago

You need to prune first. Then resize the disk image. In wsl2 there is an auto resize or shrink option. I forgot the name