本文介绍了在其他驱动器中移动boot2docker和.docker文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是码头工人的新人我在D盘中的Windows中安装了Docker,但是Boot2docker VM位于C盘中的用户文件夹中。



我没有足够的空间在C和boot2docker当我从码头中心拉出软件时,正在增长。



所以我想移动D盘中的boot2docker或.docker文件夹。



可以吗?我该怎么办?

解决方案

移动现有磁盘



VM机器的大尺寸是 .vmdk .vdi ,所以你只需要将磁盘移动到驱动器D,而不是移动整个 .docker 目录。



您可以以简单的方式在Oracle VirtualBox Manager GUI中:


  1. 停止 boot2docker VM,并找到该位置 disk.vmdk
    设置 - >存储

  2. 复制 disk.vmdk 到Disk D(任何地方)

  3. 分离( - ) disk.vmdk 在VirtualBox Manager中

  4. 从磁盘D附加(+)新的 disk.vmdk 。确保SATA端口号相同

  5. 验证boot2docker env如果没有,尝试找到原因

  6. 删除 disk.vmdk 在磁盘C中,以便在迁移完成时节省空间。

它sh所有的工作,因为我总是缺乏磁盘空间,并移动这些磁盘



对于新创建的磁盘



正常,它将创建到您的使用默认用户目录,但可以使用标记 - storage-path 在创建过程中重定向到新位置

  $ docker-machine --storage-path f:create -d virtualbox dev 

请参阅


I'm new in docker. I have installed docker in windows in the D drive but the Boot2docker VM is in the user folder in the C drive.

I dont have enough space in the C and the boot2docker is growing when i pull softwares from the docker hub.

So I want to move the boot2docker or the .docker folder in the D drive.

Is it possible ? and how can i do ?

解决方案

Moving existing disk

The big size for the VM machine is .vmdk or .vdi, so you just need to move the disk to Drive D instead of moving whole .docker directory.

What you can do in simple way in Oracle VirtualBox Manager GUI:

  1. Stop the boot2docker VM, and find the place disk.vmdk underSetting->Storage
  2. Copy the disk.vmdk to Disk D (any place)
  3. Detach (-) the disk.vmdk in VirtualBox Manager
  4. Attach (+) the new disk.vmdk from Disk D. make sure the SATA port number is the same
  5. Verify the boot2docker env, if not, try to find the reason
  6. Remove the disk.vmdk in Disk C to save space if migration is finished.

It shall work as I am always lack of disk space and move those disks around

For new created disk

Normal it will create to your use default user directory, but it is possible to redirect to new place by using flag --storage-path during creation

$ docker-machine --storage-path f: create -d virtualbox dev

see related questions in How can I make docker-machine create a VM in a specific location

这篇关于在其他驱动器中移动boot2docker和.docker文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-27 01:25