I am using docker toolbox on Windows 7 to run docker. (docker version 1.9.1)
As it turns out, the docker machine creates its VM at C:\\Users\\username\\.docker\\mach
Since 2015, there is now (June 2017) Hyper-V, which allows you to define where you want your VHDX files:
See Docker for Windows 1.13.0, 2017-01-19 (stable):
VHDX file containing images and non-host mounted volumes can be moved (using “advanced” tab in the UI)
That will modify the %APPDATA%\Docker\settings.json with a line:
"MobyVhdPathOverride":"C:\\Users\\Public\\Documents\\Hyper-V\\New folder\\MobyLinuxVM.vhdx"
See this thread for more.
Original answer
Currently 2015 , docker-machine forces the use of %USERPROFILE%:
See libmachine/mcnutils/utils.go#L17-L25
As commented in issue 499:
In the meantime, how will users be able to specify where the
.docker/machine/*files are stored?you can by specifying
--storage-pathon the command line or using the environment variableMACHINE_STORAGE_PATH.
(You can see it implemented in PR 1941)
Joost Den Boer points out in the comments
Just tried '
-s' on a Mac and it seems to work fine.
What might not be obvious is that the path option goes before the command.
Running "docker-machine -s /Volumes/other/location' create --driver=virtualbox" created a new VirtualBox image at the other location.