2015-08-28 81 views
3

我在OSX(Mac Book)上使用Docker-machine並將圖像放置在~/.docker/machine中。我的驅動器已滿,我想將圖像移動到另一個驅動器。如果有安裝選項或者爲.docker和子目錄指定不同位置的方法,那將會很好。OSX上的docker-machine virtualbox圖像位置

有沒有人沒有一個簡單的方法來做到這一點?

+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 
+0

差不多的作品,但得到意想不到的錯誤剛開機網址:退出狀態255,當我嘗試設置env - 與符號鏈接相同的錯誤 - 必須與我的驅動器或權限有關 - 我可以在Virtual Box中啓動VM並運行 - 只是無法訪問它 – tbrooke