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

  • Why does Liquibase migration on MySQL database die after acquiring lock on DC/OS (worked fine with docker-compose)?
  • How to add a mount on a docker swarm service with the specified owner
  • DistributionNotFound when running pserve with docker-compose
  • How to ssh into docker-machine VirtualBox instance?
  • Docker for Windows doesn't work
  • Mongodb replicaset on gke not working
  • #!/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?

  • Docker CMD weirdness when ENTRYPOINT is a shell script
  • Docker containers with multiple log sources
  • Cannot install Django on docker
  • Node http request to Docker Remote API - No response
  • Run a Docker image as a command line utility in Windows?
  • How do I run a salt state on a running docker container
  • 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.