Docker host on Windows, low disk space

Maarten Merken
Aug 29, 2017 · 2 min read

I recently came into trouble with Docker on my Windows machine because it was using too much disk space. Docker uses a Mobilinux VM as a virtual Docker host, eventually this VM will grow in size. Also, your working Docker folder for downloading the images will grow as well.

You can not move these folders, because Docker doesn’t support this, yet.

However, you can copy the folder to another disk and create a symlink from the original location to the new one.

There are two folder that you need to consider moving:

  • C:\Users\Public\Documents\Hyper-V\Virtual hard disks
  • C:\ProgramData\Docker

The first folder will house the MobiLinux VM and the second will contain all the volumes, images, plugins, …

Step 1: Shut down Docker

Step 2: Copy the contents of these folders to another disk (E:\ for example)

Step 3: Rename the original folders (Virtual hard disks_old, Docker_old)

Step 4: Create symlinks

In order to create a symlink, open the folder in command line (run as administrator) and type the following:

cd C:\Users\Public\Documents\Hyper-V

mklink /D “Virtual hard disks” “E:\Virtual hard disks”

cd C:\ProgramData

mklink /D “Docker” “E:\Docker”

After that, start up Docker to verify that it still works. If it does, you can safely delete the original folders.

Your C: drive should now be >15GB lighter.

Agilix

Consultancy & Development

)

Maarten Merken

Written by

Freelance Software Engineer

Agilix

Agilix

Consultancy & Development

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade