Docker Community Forums

Share and learn in the Docker community.

Move images to another HDD partition

I want to move my docker images to another partition. Currently it is filling up my C: drive. I could neither find the directory where the current images are stored nor any option to move/change the location of docker images. Is it even possible to do it?

I am running docker version 1.12.0-rc2 on Windows 10.

Using the Docker for Windows Beta, you can change the location of the harddrive file of your MobyLinuxVM in the Hyper-V Manager.

1 Like

Thanks for you feedback

We are not super efficient at maintaining Docker for windows running in a healthy state if you start tampering with the vm through the Hyper-V Manager.

Although we don’t provide a clean way through the UI to do this.

We’re working on it.

Thanks! I was able to get things working.

I opened Hyper-V manager and found out the location of the VM image (C:\Users\Public\Documents\Hyper-V\Virtual Hard Disks\MobyLinuxVM.vhdx). I closed the docker, and the Hyper-V manager and copied the VM disk to the location I wanted. I opened Hyper-V manager, updated the VM settings and voila!

This worked well for me!

Thanks!

This doesn’t seem to be persisting on restarts.

  1. Shutdown Docker
  2. Move the image via Hyper-V Manager (from C to V drive)
  3. Inspect VM settings, Docker is located on V drive :slight_smile:
  4. Start Docker
  5. Inspect VM settings, Docker is located on C drive :slight_frown:

Using Docker for Windows 1.12.5 and Windows 10

The latest betas let you change the data location: https://docs.docker.com/docker-for-windows/release-notes/#/beta-33-release-notes-2016-12-15-1130-rc3-beta33

1 Like

I see the option, but the Advanced tab remains stubbornly grayed out/disabled, even after an uninstall/restart/install of Docker and with the “Advanced” toggle on the Daemon tab set.

Removing Docker, setting the default storage location in Hyper-V, and then installing Docker again appears to work. Possibly a bug in Windows (insider build 14986).

2 Likes

Using Docker desktop Version 2.0.0.3. Windows 10, this worked for me:

  1. Shutdown Docker
  2. Shutdown Hyper-V service
  3. Copy the image with windows explorer ( C to X drive)
  4. Start up Hyper-V Service
  5. Change Hyper-V machine settings for hard disk and set to new location.
  6. In Hyper-V own settings (!! crucial step), change Hard Disks default location to the same location (! without this docker will re-create disk in default location back in the C drive)
  7. Start-up docker and in machine advanced settings check HDD settings.