Issue:
I am trying to create a host on DigitalOcean using docker-machine
. The host does get created, but the docker daemon fails to run on it.
I used the command
docker-machine create --driver digitalocean --digitalocean-access-token xxxx docker-sandbox
, where xxxx is the token that I generated from DigitalOcean
This command fails with an ssh error. Logs are as shown below:
Creating CA: /root/.docker/machine/certs/ca.pem
Creating client certificate: /root/.docker/machine/certs/cert.pem
Running pre-create checks…
Creating machine…
(docker-sandbox) Creating SSH key…
(docker-sandbox) Creating Digital Ocean droplet…
(docker-sandbox) Waiting for IP address to be assigned to the Droplet…
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 ubuntu(systemd)…
Installing Docker…
Copying certs to the local machine directory…
Copying certs to the remote machine…
Setting Docker configuration on the remote daemon…
Error creating machine: Error running provisioning: ssh command error:
command : sudo systemctl -f start docker
err : exit status 1
output : Job for docker.service failed because the control process exited with error code. See “systemctl status docker.service” and “journalctl -xe” for details.
docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
docker-sandbox - digitalocean Running tcp://104.131.172.210:2376 Unknown Unable to query docker version: Cannot connect to the docker engine endpoint
OS Version/build:
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION=“Ubuntu 16.04.2 LTS”
NAME=“Ubuntu”
VERSION=“16.04.2 LTS (Xenial Xerus)”
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME=“Ubuntu 16.04.2 LTS”
VERSION_ID=“16.04”
HOME_URL=“http://www.ubuntu.com/”
SUPPORT_URL=“http://help.ubuntu.com/”
BUG_REPORT_URL=“Bugs : Ubuntu”
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
docker-machine version:
docker-machine version 0.12.0, build 45c69ad
Steps to reproduce:
- Generate a personal access token from DigitalOcean
- Run the command
docker-machine create --driver digitalocean --digitalocean-access-token xxxx docker-sandbox
replacing xxxx with the personal access token you earlier generated - The command fails with an error as described above.
P.S: I am a newbie. Please add descriptions as much as possible for the solution.