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):

  • Docker - Cassandra
  • Docker - how can I copy a file from an image to a host?
  • Save file from Python script to Docker Container
  • Docker Compose: Accessing my webapp from the browser
  • Running django management command on docker cloud
  • Why does boot2docker ip fail?
  • #!/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                          \
      echo "Must have server name!"

    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?

  • ArangoDB Services from Web Interface not accessible
  • How do I make my Docker container communicate with another node through a 2nd interface?
  • Docker compose new image and instance
  • Cloud SDK command gsutil config -a
  • PM2 Keymetrics on Docker on Elastic Beanstalk configuration
  • error with docker-compose and django
  • 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:

    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):

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