When creating a new instance, the process attempts to stop the existing docker service. If Docker is not already installed this causes the 'service docker stop' command to fail, which in turn aborts the 'docker-machine create'. This causes an issue for individuals using private machine images that do not already have Docker installed. I ran into this using the OpenStack driver but it shouldn't be specific to any particular driver.
EDIT: Added further debug messages so you can see it step through the process.
INFO[0001] Creating machine...
DEBU[0003] Waiting for the OpenStack instance to be ACTIVE... MachineId=XXXXXXXXXX
DEBU[0019] Looking for the IP address... MachineId=XXXXXXXXXX
DEBU[0019] IP address found IP=XXXXXXXX MachineId=XXXXXXXXXXX
DEBU[0019] Waiting for the SSH server to be started... IP=XXXXXXXX MachineId=XXXXXXXXXXX
DEBU[0040] generating server cert: /home/USERNAME/.docker/machine/machines/foo/server.pem ca-key=/home/USERNAME/.docker/machine/certs/ca.pem private-key=/home/USERNAME/.docker/machine/certs/ca-key.pem org=foo
DEBU[0041] Stopping Docker...
DEBU[0041] Command: %s[sudo sh -c 'sudo service docker stop'] MachineId=XXXXXXXXXXXXXDEBU[0041] executing: ssh -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -p 22 -i /home/USERNAME/.docker/machine/machines/foo/id_rsa deploy@XXXXXXXXX sudo sh -c 'sudo service docker stop'
ERRO[0041] Error creating machine: exit status 255
WARN[0041] You will want to check the provider to make sure the machine and associated resources were properly removed.
FATA[0041] Error creating machine
When creating a new instance, the process attempts to stop the existing docker service. If Docker is not already installed this causes the 'service docker stop' command to fail, which in turn aborts the 'docker-machine create'. This causes an issue for individuals using private machine images that do not already have Docker installed. I ran into this using the OpenStack driver but it shouldn't be specific to any particular driver.
EDIT: Added further debug messages so you can see it step through the process.
INFO[0001] Creating machine... DEBU[0003] Waiting for the OpenStack instance to be ACTIVE... MachineId=XXXXXXXXXX DEBU[0019] Looking for the IP address... MachineId=XXXXXXXXXX DEBU[0019] IP address found IP=XXXXXXXX MachineId=XXXXXXXXXXX DEBU[0019] Waiting for the SSH server to be started... IP=XXXXXXXX MachineId=XXXXXXXXXXX DEBU[0040] generating server cert: /home/USERNAME/.docker/machine/machines/foo/server.pem ca-key=/home/USERNAME/.docker/machine/certs/ca.pem private-key=/home/USERNAME/.docker/machine/certs/ca-key.pem org=foo
DEBU[0041] Stopping Docker...
DEBU[0041] Command: %s[sudo sh -c 'sudo service docker stop'] MachineId=XXXXXXXXXXXXXDEBU[0041] executing: ssh -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -p 22 -i /home/USERNAME/.docker/machine/machines/foo/id_rsa deploy@XXXXXXXXX sudo sh -c 'sudo service docker stop' ERRO[0041] Error creating machine: exit status 255
WARN[0041] You will want to check the provider to make sure the machine and associated resources were properly removed. FATA[0041] Error creating machine