By default Docker will download and store your Container images on your C drive. This is less than helpful on most Windows machines (even desktops).
Therefore, we want to avoid this if possible, placing them on a drive and location of our choice.
There seems to be scant information about this on the internet and so I thought I’d make special mention here.
NOTE – This ONLY works if you are using Windows Containers in a Windows environment. If you are using Linux Containers on a Windows machine, do NOT do this as it will crash
As mentioned, it defaults to C and therefore we’ll move this somewhere more friendly. In my case I’ve created a folder on my E drive so that I can keep the Containers out of the way and also on a nice and speedy drive.
To make this move we need to go to Settings:
Then select "Docker Engine":
You’ll see there’s a JSON config you can enter here. Also note the big red warning on it. But we’ll edit it anyway…
We want to use a config called “data-root” as follows (remembering I’m using E:\Docker, you might be using something else):
This is REALLY useful for making sure your C drive doesn’t bloat.
Again, this ONLY works if you’re using Windows Containers in Windows.