Docker Community Forums

Share and learn in the Docker community.

Windows container disk size keeps growing (more than actual disk usage)


I’m a new Docker Desktop for Windows user. I’m using Windows containers, got my image set up, but now I run into a problem where the virtual disk associated with the container keeps growing, e.g. reaching 3GB despite only using about 300MB disk space inside the container.

I have a few suspicions, but can’t seem to find proof:

  1. The pagefile probably is being used, but there’s no C:\pagefile.sys in the container. Is there some way I can check this, or is there even a pagefile inside the container?
  2. My app generates lots of temporary files and deletes them soon after. Could Hyper-V have a problem with these temporary files?

I have to run several copies of the image simultaneously (the intention is to run the copies, then delete them once they stop, no permanent data needs to be kept in the containers). Unfortunately, with each one taking up more than 3GB, I quickly run out disk space.

Unfortunately, the app running in the container can’t run on Linux, so I’m left with Windows containers, or else making full virtual machines in VMWare or VirtualBox. The app uses COM and MS message queues, in case that has any connection to the problem.

Please advise on how I can go about stopping this crazy virtual disk growth - 3GB in under an hour is a big problem for me.