This is not a duplicate of Change Docker machine location - Windows
I\'m using docker native, version 1.12.1-stable (build: 7135) on Windows 10 Pro with Hyp
There is an easier way to do this: Go to Docker Settings > Advanced > Change "Disk image location" and click "Apply" when prompted. Docker engine will shut down the VM and move it for you to the new location.
Warning: new location must not be compressed. If it is then Docker will not show you any error, just won't change location.
None of these steps worked for me. After reboot or a Docker restart, it would move back to the original path. What worked for me is using Junction
stop docker engine
create a target folder in the new location:
mkdir d:\docker\vhd
copy the folder Virtual Hard Disks
to the target folder
rename (and backup) the original folder
rename “C:\Users\Public\Documents\Hyper-V\Virtual hard disks” “C:\Users\Public\Documents\Hyper-V\Virtual hard disks_backup”
create a hard symbolic link (junction)
junction.exe "C:\Users\Public\Documents\Hyper-V\Virtual Hard Disks" "d:\docker\vhd\Virtual Hard Disks"
start docker engine
For Those looking in 2020. The following is for Windows 10 Machine:
In 2020 to "Change Docker native images location on Windows 10 Pro" is,
Edit the Docker Daemon configuration and use "data-root": "D:\\docker"
instead of "graph": "/D/docker"
.
That will move all the newly downloaded images to D:\docker
folder.
For Old Docker version use graph
"graph": "D:\\docker"
, "graph" has been deprecated.
Docker Version : 2.2.0.3 (42716)
3 Click on Resources from the left-hand menu then under the Disk Image location click on browse and change the location