For the past month, I have been working on making docker-machine work on Azure using our azure-sdk-for-go. Now that it is upstream, I would love to talk about it. But first, here is a demo:

For those who are following Docker on Azure topic closely, we had our first Docker Machine driver back in October 2014 —this was back in the day Docker Machine was actually going to be released as docker hosts command.

Why a rewrite?

Azure has recently released new set of REST APIs and the old driver was using the legacy Azure APIs that did not really give users enough flexibility and functionality to do everything. These new and old APIs are also not compatible with each other. Therefore we had to start from scratch.

Docker Machine Azure Driver has been the first project we developed using (read: dogfooding) Azure Go SDK our team has developed, therefore we had a chance to see some of the pain points and had a chance to make it a ton better.

The new driver also addresses a ton of feature requests and issues about the old azure driver on GitHub, brings it on par, if not better, to the other public cloud drivers.

What’s New?

With this rewrite, creating a Linux VM in Azure running Docker is as easy as:

$ export AZURE_SUBSCRIPTION_ID=<guid>
$ docker-machine create --driver azure <name>
...

Of course, such a short command often means it just has great defaults (such as region, VM size, OS image, username, SSH port). However, with this rewrite we are giving users ability to specify a detailed set of options:

  • Virtual Network (interconnects your docker VMs over VLAN)
  • Availability Sets (maximizes uptime for your VMs)
  • specify Subnet CIDR Range (private IP block for your VMs)
  • specify static private IP address for the VM in Virtual Network
  • specify the port number Docker Engine will be running
  • whether a public IP address should be created for the VM
  • whether that public IP should be static or ephemeral
  • whether VM should communicated entirely over private IP
  • extra TCP port numbers to be opened for Internet traffic

All these features give users finer control over how their VMs are created and placed within the network and compute topology.


If this looks interesting to you, please learn more about Docker Machine, read the docs for the Azure driver or take a look at the pull request, or just try it out.