Question

How to create a droplet from docker-machine

A few weeks ago, I created a droplet using docker-machine by following these articles as my guide:

https://docs.docker.com/machine/examples/ocean/ https://www.digitalocean.com/community/tutorials/how-to-provision-and-manage-remote-docker-hosts-with-docker-machine-on-ubuntu-16-04

Everything worked fine and I was able to see the droplet on my dashboard.

Since then I upgraded from Mountain Lion to El Capitan and re-installed docker toolbox. I don’t recall the versions of docker the docker toolbox loaded previously, but now I’m using:

docker-machine version 0.7.0, build a650a40

docker-compose version 1.7.1, build 0a9ab35 docker-py version: 1.8.1 CPython version: 2.7.9 OpenSSL version: OpenSSL 1.0.1j 15 Oct 2014

docker version Client: Version: 1.11.2 API version: 1.23 Go version: go1.5.4 Git commit: b9f10c9 Built: Wed Jun 1 21:20:08 2016 OS/Arch: darwin/amd64

Now, when I try to create a new droplet using docker-machine I get the following error:

docker-machine create --driver digitalocean --digitalocean-access-token xxxxx docker-sandbox Running pre-create checks… Creating machine… (docker-sandbox) Creating SSH key… (docker-sandbox) Creating Digital Ocean droplet… Error creating machine: Error in driver during machine creation: POST https://api.digitalocean.com/v2/droplets: 422 You specified an invalid image for Droplet creation.

Has something changed in the DigitalOcean API in the last few weeks that now causes this command to fail? Does El Capitan not support this ability with Docker? Or, am I missing some important component when I did the re-install?

I sure would like to be able to use this capability, as it seems like it would be very beneficial.

Thanks in advance for any assistance you can offer.


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Ryan Quinn
DigitalOcean Employee
DigitalOcean Employee badge
July 27, 2016
Accepted Answer

There has not been any recent change to the create API endpoint that could cause this issue. From the output provided the actual error coming from DigitalOcean is

422 You specified an invalid image for Droplet creation.

This means that the DigitalOcean disk image specified could not be used. This value can either be an image slug like ubuntu-14-04-x64 for our stock Ubuntu 14.04 image or docker for our Docker One-Click image or it can be an image ID number which can identify a snapshot image on your account. There are a few reasons this error could happen.

1.) The image specified does not exist.

2.) The image specified does not exist in the data center you have specified (you can move an image to more regions from the Images section of the control panel)

3.) The image specified does not belong to the account you are using (an image can be transferred to a new account from the Images section of the control panel if needed).

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.