Docker Community Forums

Share and learn in the Docker community.

Windows Scratch Space slow

Hello

Windows Containers get a default 20 GB Scratch “vhdx” file to save the temporary data. This is also used when building Docker Images. Now that scratch space seems extremely slow.
One example is the installation of Visual Studio 2015 in a Container (don’t ask why I need this…).
The command in the Dockerfile looks something like;

RUN (New-Object net.webclient).Downloadfile('https://download.microsoft.com/download/e/4/c/e4c393a9-8fff-441b-ad3a-3f4040317a1f/vs_community.exe', 'vs_community.exe'); `
    Start-Process -FilePath 'vs_community.exe' -Wait -ArgumentList `
        '/norestart', '/silent', '/InstallSelectableItems', `
        '/l C:\Temp\vs2015.log'; `
    Remove-Item 'vs_community.exe';

Now running that takes about 4 hours in a Docker container (when using process isolation, I guess Hyper-V isolation would be even slower).

Running the exact same command in a “real” Windows or VM takes at max 30 Minutes.

I also have something else that grows the sandbox.vhdx file to about 8 gb and this takes as well 50 minutes in a container and about 10 minutes outside a container.

Is there anything that can be done to improve the performance of the scratch space? Or even some way to directly use a temporary folder on the host instead of the virtual disk?

Thanks for suggestions