我怎么能更改Docker存储驱动程序到mac上的devicemapper

我正在尝试在Mac上将存储驱动程序更改为devicemapper。 并遵循Mac OS X上的Change docker存储驱动程序中的步骤

但我得到了以下错误,我的docker为Mac是最新版本。

$ docker-machine create --driver virtualbox --engine-storage-driver devicemapper test2 Running pre-create checks... Creating machine... (test2) Copying /Users/weiwang/.docker/machine/cache/boot2docker.iso to /Users/weiwang/.docker/machine/machines/test2/boot2docker.iso... (test2) Creating VirtualBox VM... (test2) Creating SSH key... (test2) Starting the VM... (test2) Check network to re-create if needed... (test2) Waiting for an IP... Waiting for machine to be running, this may take a few minutes... Detecting operating system of created instance... Waiting for SSH to be available... Detecting the provisioner... Provisioning with boot2docker... Copying certs to the local machine directory... Copying certs to the remote machine... Setting Docker configuration on the remote daemon... Checking connection to Docker... Error creating machine: Error checking the host: Error checking and/or regenerating the certs: There was an error validating certificates for host "192.168.99.105:2376": read tcp 192.168.99.1:49168->192.168.99.105:2376: read: connection reset by peer You can attempt to regenerate them using 'docker-machine regenerate-certs [name]'. Be advised that this will trigger a Docker daemon restart which will stop running containers. 

注意:请阅读更新

Devicemapper不再受支持。 你可以使用叠加也很不错。

用法: docker-machine create --driver virtualbox --engine-storage-driver overlay test2

编辑:

我最初的评论没有正确回答这个问题。 在对devicemapper存储驱动程序的工作方式进行了一些研究之后,事实certificate,默认的boot2docker基本操作系统docker -machine使用的不支持devicemapper存储驱动程序。

这是一个支持的发行版列表:

  • RHEL / CentOS的/ Fedora的
  • Ubuntu 12.04
  • Ubuntu 14.04
  • Debian的

更详细的信息可以在这里find。

所以要解决这个问题,你需要在虚拟机中安装一个提到的发行版。 添加一个SSH服务器和一个无密码的sudo用户,可以不用tty运行命令。

我在VirtualBox上安装了一个CentOS虚拟机,添加了一个NAT和一个Host-only驱动程序(用于下载Internet包的NAT,以及Docker-machine和VM可以通信的专用networking的Host only适配器) )

设置VM之后,可以使用以下命令将其连接到docker-machine。 docker机将ssh进入虚拟机,并检查是否安装了Docker引擎。 如果不是这样的话,它会被自动下载和configuration。

 docker-machine create \ --driver generic \ --generic-ip-address=192.168.58.14 \ --generic-ssh-port 22 \ --generic-ssh-key ~/.ssh/id_rsa \ --engine-storage-driver devicemapper \ docker-centos 

有关在此处使用通用驱动程序的更多信息: https : //docs.docker.com/machine/drivers/generic/

希望这可以帮助你更多的方式比最初的答案:)