我在OSX(Mac Book)上使用docker-machine,它将图像放在~/.docker/machine
中。我的驱动器几乎已满,我想将图像移动到另一个驱动器。如果有一个安装选项或方法为.docker
和子目录指定不同的位置,那将是很好的。
有没有人没有这么简单的方法呢?
答案 0 :(得分:1)
可以使用MACHINE_STORAGE_PATH
环境变量或指定-s, --storage-path
之一:
$ export MACHINE_STORAGE_PATH=/Volumes/Drobo/machine
$ mkdir $MACHINE_STORAGE_PATH
$ docker-machine create test -d virtualbox
Creating CA: /Volumes/Drobo/machine/certs/ca.pem
Creating client certificate: /Volumes/Drobo/machine/certs/cert.pem
Image cache does not exist, creating it at /Volumes/Drobo/machine/cache...
No default boot2docker iso found locally, downloading the latest release...
Downloading https://github.com/boot2docker/boot2docker/releases/download/v1.8.1/boot2docker.iso to /Volumes/Drobo/machine/cache/boot2docker.iso...
Creating VirtualBox VM...
Creating SSH key...
Starting VirtualBox VM...
Starting VM...
To see how to connect Docker to this machine, run: docker-machine env test
$
$ ls -l /Volumes/Drobo/machine/machines/
total 0
drwx------ 13 brianz staff 442 Aug 28 16:37 test