Docker Machine with an existing Azure VNET

Last week I had to provision a Docker host and I tried out the docker-machine command. The resulting host would have to use an existing Azure subnet from another resource group and I also needed to be able to reach the machine using it’s private IP.

After reading the docs and playing for some minutes I came up with the correct command to use Docker Machine with an existing Azure VNET:

1
2
3
4
   docker-machine create --driver azure --azure-subscription-id [subscriptionid]  `
       --azure-resource-group [Resource group] --azure-location [Azure location]  `
       --azure-vnet [Resource group]:[Azure VNET] --azure-subnet [Azure Subnet Name]  `
       --azure-subnet-prefix [Azure subnet prefix (CIDR notation)] --azure-use-private-ip [machine name]

Hope it helps!

1 thought on “Docker Machine with an existing Azure VNET

Leave a Reply

Your email address will not be published. Required fields are marked *