Reputation: 433
I am trying to change the storage driver to devicemapper on mac. and was following the steps in Change docker storage driver on Mac OS X
but I got the following error, my docker for mac is latest version.
$ 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.
Upvotes: 0
Views: 1622
Reputation: 1131
Note: Please read the updated
Devicemapper is not supported anymore. You can use overlay which is also pretty good.
Usage:
docker-machine create --driver virtualbox --engine-storage-driver overlay test2
Edit:
My initial comment didn't answer the question correctly. After some more research into how the devicemapper storage driver works it turns out that the default boot2docker base OS docker-machine uses doesn't support the devicemapper storage driver.
Here's a list of supported distros:
More detailed information can be found here.
So to solve the issue, you need to install one of the mentioned distros in a VM. Add a SSH server and a passwordless sudo user that can run commands without a tty.
I tried this out by installing a CentOS VM in VirtualBox, adding a NAT and a Host-only driver ( NAT for downloading packages of the internet, and a Host only adapter for a private network that docker-machine and the VM can communicate in. )
After setting up the VM, you can use the following command to connect it to docker-machine. docker-machine will ssh into the VM and check if the Docker Engine is installed. If that's not the case, it will be automatically downloaded and configured.
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
More info on using the generic driver here: https://docs.docker.com/machine/drivers/generic/
Hope this is helps you a bit more on the way than the initial answer :)
Upvotes: 1