docker-machine create with digitalocean driver and Ubuntu 16.04 x64 fails

I am attempting to create a docker machine on Digital Ocean, but with the 16.04 LTS instead of the default 15.10. The do-access-token file contains my token.

Here’s the script (create-do):

  • How to Increase number of cpus on Docker
  • Docker command won't connect to docker
  • Jenkins docker plugin with docker slaves
  • Do pushes to docker hub always increment the “pull” count?
  • How to make sure docker's time syncs with that of the host?
  • Tips on getting docker to work without having to run `sudo docker -d` on Ubuntu 15.04
  • #!/usr/bin/env bash
    # Creates a digital-ocean server with Ubuntu 16.04 instead of the default
    if [ "$1" != "" ]; then
    echo "Creating: " $1
    docker-machine                                          \
      create                                                \
      --driver digitalocean                                 \
      --digitalocean-access-token=`cat do-access-token`   \
      --digitalocean-image=ubuntu-16-04-x64             \
      --digitalocean-ipv6=true                          \
      $1
    else
      echo "Must have server name!"
    fi
    

    When I run the script like this:

    $ ./create-do ps-server
    

    It successfully allocates the machine at Digital Ocean, then craps out with this:

    Creating:  ps-server
    Running pre-create checks...
    Creating machine...
    (ps-server) Creating SSH key...
    (ps-server) Creating Digital Ocean droplet...
    (ps-server) 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)...
    Error creating machine: Error running provisioning: Something went wrong 
    running an SSH command!
    command : sudo apt-get update
    err     : exit status 100
    output  : Reading package lists...
    E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
    E: Unable to lock directory /var/lib/apt/lists/
    

    The machine is running, but I can’t get to it since the SSH key was apparently not set before things started going wrong.

    Anyone seen this before and/or have a work-around?

  • How to get a fulfilled MySQL database in Travis
  • Saving changes in docker project
  • Sharing /etc/passwd between two Docker containers
  • Spring Boot 1.4.1 SSL trustAnchors exception
  • Openshift imagestream “Import failed (Unauthorized)” for private external secure registry
  • adding a command docker image
  • 2 Solutions collect form web for “docker-machine create with digitalocean driver and Ubuntu 16.04 x64 fails”

    this worked for me:

    docker-machine provision your-node
    

    I’ve taken this solution from here: https://github.com/docker/machine/issues/3358

    I hope this helps!

    Update: May 21, 2016
    Broken again with same error this morning. Tried 4 times, failed same way each time.

    Update: May 20, 2016

    This was, according do Digital Ocean’s support, due to an issue with their Ubuntu 16.04 image which has now been corrected and I have confirmed that this now works.

    Related GitHub issue (not yet closed):

    https://github.com/docker/machine/issues/3358

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.