Hello,
I recently started using the Docker container for Duplicati. I’m currently running it on a Windows machine with Docker Desktop, which uses WSL2 under the hood.
While experimenting with Duplicati, I noticed that my C:\ drive ran out of disk space during a backup. After investigating with a disk usage tool, I found that a file located at:
AppData\Local\Docker\wsl\disk\docker_data.vhdx
had grown to 120GB. Initially, I checked my Docker volumes, thinking the backup process might be consuming excessive space inside the container, but all volumes appeared to be small.
After further research, I came across the following command:
optimize-vhd -Path C:\Users\XXXX\AppData\Local\Docker\wsl\disk\docker_data.vhdx -Mode Full
Running this reduced the file size from 120GB to 23.9GB.
I also found a related discussion on the Duplicati forums suggesting that, during backups, the container frequently creates and deletes files in the /tmp/ directory. My understanding is that this behavior can cause the docker_data.vhdx file to grow rapidly, even though the space is later freed internally but not reclaimed by the host filesystem.
Could you please confirm if this understanding is correct?
If so, it might be helpful to include a note in the Docker-related documentation recommending that users mount a host directory to /tmp/ within the container. This could help prevent the virtual disk file from growing excessively.
Additionally, it may be worth mentioning that, without this setup, users might need to periodically compact the VHDX file (for example, via a scheduled task or cron job) to reclaim unused space. Otherwise, the file may continue to grow and eventually consume a significant amount of disk space.
Thank you.