51718

docker-machine create with digitalocean driver: ssh command error

I´m using docker tools on windows.

create command was working perfectly last week and I managed to create a number of machines on Digital Ocean. Then I tried today with no success. I repeated the same command with different regions and I always get the same result:

λ docker-machine create -d digitalocean --digitalocean-access-token=MYTOKEN --digitalocean-region=ams2 vmname Running pre-create checks... Creating machine... (fernu) Creating SSH key... (fernu) Creating Digital Ocean droplet... (fernu) 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.

If I execute the suggested command:

root@fernu:~# systemctl status docker.service ● docker.service - Docker Application Container Engine Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled) Drop-In: /etc/systemd/system/docker.service.d └─10-machine.conf Active: inactive (dead) (Result: exit-code) since Fri 2017-06-30 20:56:13 UTC; 8min ago Docs: https://docs.docker.com Process: 4943 ExecStart=/usr/bin/docker daemon -H tcp://0.0.0.0:2376 -H unix:///var/run/docker.sock --storage-driver aufs --tlsverify --tlscacert /etc/docker/ca.pem --tlscert /etc/docker/server.pem --tlskey /etc/docker/server-key.pem --label provider=digitalocean (code=exited, status=1/FAILURE) Main PID: 4943 (code=exited, status=1/FAILURE) Jun 30 20:56:13 fernu systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE Jun 30 20:56:13 fernu systemd[1]: Failed to start Docker Application Container Engine. Jun 30 20:56:13 fernu systemd[1]: docker.service: Unit entered failed state. Jun 30 20:56:13 fernu systemd[1]: docker.service: Failed with result 'exit-code'. Jun 30 20:56:13 fernu systemd[1]: docker.service: Service hold-off time over, scheduling restart. Jun 30 20:56:13 fernu systemd[1]: Stopped Docker Application Container Engine. Jun 30 20:56:13 fernu systemd[1]: docker.service: Start request repeated too quickly. Jun 30 20:56:13 fernu systemd[1]: Failed to start Docker Application Container Engine.

Any help would be appreciated

<strong>Update</strong>

It´s working with ubuntu 14: --digitalocean-image=ubuntu-14-04-x64 so it seams like a problem with the default image (ubuntu-16-04-x64)

Answer1:

This seems to be hitting a lot of people. TL;DR: There is a bug in docker-machine v0.12.0 and this issue can be resolved by upgrading.

Logging in to the DigitalOcean instance and running journalctl -xe provides more information:

-- Unit docker.service has begun starting up. Jul 07 20:03:52 docker-sandbox docker[4930]: `docker daemon` is not supported on Linux. Please run `do Jul 07 20:03:52 docker-sandbox systemd[1]: docker.service: Main process exited, code=exited, status=1/ Jul 07 20:03:52 docker-sandbox systemd[1]: Failed to start Docker Application Container Engine. -- Subject: Unit docker.service has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

The key here is docker daemon is not supported on Linux. A bug in docker-machine's version comparison code caused an incorrect systemd unit file to be produced (located at /etc/systemd/system/docker.service.d/10-machine.conf) on certain versions of Ubuntu.

A fix has been committed and a new release (v0.12.1) was made.

You can grab the latest release at: https://github.com/docker/machine/releases/tag/v0.12.1

Recommend

  • Enabling non root user to run tomcat with port 443
  • Oracle Rest Data Service (ORDS) URL link
  • Nginx: Permission denied to Gunicorn socket on CentOS 7
  • How start apache in centOS 7
  • Error while installing ggplot in python
  • How do I run my Specs with the previous version of Rspec?
  • missing pie chart and other elements when display serenity report from jenkins
  • Using docker environment -e variable in supervisor
  • Ionic storage “get” returns null only on the second call within method
  • Symfony 2 error page response
  • How do I get the list of bad records that didn't load in Bigquery?
  • SQL Query - Table Joining Problems
  • Can't remove headers after they are sent
  • Ubuntu and bcrypt
  • Problems installing Yesod for Haskell
  • Using JRuby with Rails 3.2
  • Code in Job's Script Block after Start-Process Does not Execute
  • Unable to install Git-core+svn by MacPorts
  • Specifying Castle WCF Integration Facility Endpoint Behavior per Endpoint
  • How to use JavaScript to determine whether a file exists in a directory?
  • How do I pass the string value parameter of the selected list item from an auto-populated dropdown l
  • VSO Build — Response status code does not indicate success: 404 (Not Found)
  • ilmerge with a PFX file
  • Nant, Vault & Windows Integrated Authentication
  • Is there a amazon webstore API for customers?
  • Bug in WPF DataGrid
  • Obtain ObjectIdHex value from mgo query
  • Can I have the cursor start on a particular column by default in jqgrid's edit mode?
  • jQuery tmpl and DataLink beta
  • How can I estimate amount of memory left with calling System.gc()?
  • Circular dependency while pushing http interceptor
  • using conditional logic : check if record exists; if it does, update it, if not, create it
  • python regex in pyparsing
  • Hits per day in Google Big Query
  • Angular 2 constructor injection vs direct access
  • FormattedException instead of throw new Exception(string.Format(…)) in .NET
  • Android Google Maps API OnLocationChanged only called once
  • Linking SubReports Without LinkChild/LinkMaster
  • XCode 8, some methods disappeared ? ex: layoutAttributesClass() -> AnyClass
  • How can I use threading to 'tick' a timer to be accessed by other threads?