Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Prevent WindowsFilter taking so much space #558

Open
f4n0 opened this issue Jun 19, 2024 · 3 comments
Open

Question: Prevent WindowsFilter taking so much space #558

f4n0 opened this issue Jun 19, 2024 · 3 comments

Comments

@f4n0
Copy link

f4n0 commented Jun 19, 2024

Hi,
Usually, I create a lot of BC containers, but they are deleted frequently (with also system prune, etc.)
Now, my question is this:
Docker tries to reuse the layer that already has, why does it seem that he always uses something new each time?

Right now the windowsfilter folder is at 100 Gb. and it keeps getting larger and I have only 2 containers!
Is there a generic, plain and simple base image that BcContainerHelper can use (that works with the majority of Win Updates) that is also not so big?

@rdebath
Copy link

rdebath commented Jun 19, 2024

For me BC is running at about 10Gb/image, however, the Microsoft versions of docker seem to have a habit of losing layers. Have a look at the script Find-OrphanDockerLayers.ps1, it cross-references the windowsfilter directory with defined images and containers and (optionally) marks bad ones for deletion. The docker daemon will delete about 5-6 marked layers each time it shuts down (You may need to restart it several times).

BTW: Windows containers cannot use most versions of windows as a guest. The Guest normally has to match the host pretty closely. This even applies to "HyperV" isolation though at least that tends to work for more. Neither mode is even close to the compatibility you get with Linux (if it were you'd be able to run Windows-XP in a container).

@f4n0
Copy link
Author

f4n0 commented Jun 19, 2024

nice script, I will check this out, but it would be nice if I do not have to do it manually

@freddydk
Copy link
Contributor

Thanks @rdebath - yeah Windows on Docker isn't as good as Linux on Docker.
Never saw this script before - I usually run this script: https://github.com/microsoft/nav-arm-templates/blob/master/CleanupAfterDocker.ps1 - which cleans up everything - and then I start from scratch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants