在OSX上,docker-machine虚拟机的镜像位置在哪里?

3
我正在使用Mac Book上的docker-machine,它将镜像放置在~/.docker/machine中。我的驱动器几乎满了,我想将镜像移动到另一个驱动器。如果有一种安装选项或指定.docker和子目录的不同位置的方法,那就太好了。

有人知道如何轻松地做到这一点吗?


你可以创建一个符号链接... - Mark Setchell
1个回答

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

几乎可以工作,但是当我尝试设置环境变量时,出现了“意外错误获取机器URL:退出状态255”的错误 - 与符号链接相同的错误 - 必须是我的驱动器或权限的问题 - 我可以在Virtual Box中打开虚拟机并运行它 - 只是无法访问它。 - tbrooke

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接