docs/docs/index.md

32 KiB
Raw Blame History

page_title: Docker Machine page_description: Working with Docker Machine page_keywords: docker, machine, virtualbox, digitalocean, amazonec2

Docker Machine

Note: Machine is currently in beta, so things are likely to change. We don't recommend you use it in production yet.

Machine makes it really easy to create Docker hosts on your computer, on cloud providers and inside your own data center. It creates servers, installs Docker on them, then configures the Docker client to talk to them.

Once your Docker host has been created, it then has a number of commands for managing them:

  • Starting, stopping, restarting
  • Upgrading Docker
  • Configuring the Docker client to talk to your host

Installation

Docker Machine is supported on Windows, OSX, and Linux. To install Docker Machine, download the appropriate binary for your OS and architecture to the correct place in your PATH:

Now you should be able to check the version with docker-machine -v:

$ docker-machine -v
machine version 0.1.0

Getting started with Docker Machine using a local VM

Let's take a look at using docker-machine to creating, using, and managing a Docker host inside of VirtualBox.

First, ensure that VirtualBox 4.3.20 is correctly installed on your system.

If you run the docker-machine ls command to show all available machines, you will see that none have been created so far.

$ docker-machine ls
NAME   ACTIVE   DRIVER   STATE   URL

To create one, we run the docker-machine create command, passing the string virtualbox to the --driver flag. The final argument we pass is the name of the machine - in this case, we will name our machine "dev".

This will download a lightweight Linux distribution (boot2docker) with the Docker daemon installed, and will create and start a VirtualBox VM with Docker running.

$ docker-machine create --driver virtualbox dev
INFO[0000] Creating SSH key...
INFO[0000] Creating VirtualBox VM...
INFO[0007] Starting VirtualBox VM...
INFO[0007] Waiting for VM to start...
INFO[0038] "dev" has been created and is now the active machine
INFO[0038] To connect: docker $(docker-machine config dev) ps

To use the Docker CLI, you can use the env command to list the commands needed to connect to the instance.

$ docker-machine env dev
export DOCKER_TLS_VERIFY=yes
export DOCKER_CERT_PATH=/home/ehazlett/.docker/machines/.client
export DOCKER_HOST=tcp://192.168.99.100:2376

You can see the machine you have created by running the docker-machine ls command again:

$ docker-machine ls
NAME      ACTIVE   DRIVER       STATE     URL
dev       *        virtualbox   Running   tcp://192.168.99.100:2376

The * next to dev indicates that it is the active host.

Next, as noted in the output of the docker-machine create command, we have to tell Docker to talk to that machine. You can do this with the docker-machine config command. For example,

$ docker $(docker-machine config dev) ps

This will pass arguments to the Docker client that specify the TLS settings. To see what will be passed, run docker-machine config dev.

You can now run Docker commands on this host:

$ docker $(docker-machine config dev) run busybox echo hello world
Unable to find image 'busybox' locally
Pulling repository busybox
e72ac664f4f0: Download complete
511136ea3c5a: Download complete
df7546f9f060: Download complete
e433a6c5b276: Download complete
hello world

Any exposed ports are available on the Docker hosts IP address, which you can get using the docker-machine ip command:

$ docker-machine ip
192.168.99.100

Now you can manage as many local VMs running Docker as you please- just run docker-machine create again.

If you are finished using a host, you can stop it with docker stop and start it again with docker start:

$ docker-machine stop
$ docker-machine start

If they aren't passed any arguments, commands such as docker-machine stop will run against the active host (in this case, the VirtualBox VM). You can also specify a host to run a command against as an argument. For instance, you could also have written:

$ docker-machine stop dev
$ docker-machine start dev

Using Docker Machine with a cloud provider

One of the nice things about docker-machine is that it provides several “drivers” which let you use the same interface to create hosts on many different cloud platforms. This is accomplished by using the docker-machine create command with the --driver flag. Here we will be demonstrating the Digital Ocean driver (called digitalocean), but there are drivers included for several providers including Amazon Web Services, Google Compute Engine, and Microsoft Azure.

Usually it is required that you pass account verification credentials for these providers as flags to docker-machine create. These flags are unique for each driver. For instance, to pass a Digital Ocean access token you use the --digitalocean-access-token flag.

Let's take a look at how to do this.

To generate your access token:

  1. Go to the Digital Ocean administrator panel and click on "Apps and API" in the side panel.
  2. Click on "Generate New Token".
  3. Give the token a clever name (e.g. "machine"), make sure the "Write" checkbox is checked, and click on "Generate Token".
  4. Grab the big long hex string that is generated (this is your token) and store it somehwere safe.

Now, run docker-machine create with the digitalocean driver and pass your key to the --digitalocean-access-token flag.

Example:

$ docker-machine create \
    --driver digitalocean \
    --digitalocean-access-token 0ab77166d407f479c6701652cee3a46830fef88b8199722b87821621736ab2d4 \
    staging
INFO[0000] Creating SSH key...
INFO[0000] Creating Digital Ocean droplet...
INFO[0002] Waiting for SSH...
INFO[0085] "staging" has been created and is now the active machine
INFO[0085] To connect: docker $(docker-machine config dev) staging

For convenience, docker-machine will use sensible defaults for choosing settings such as the image that the VPS is based on, but they can also be overridden using their respective flags (e.g. --digitalocean-image). This is useful if, for instance, you want to create a nice large instance with a lot of memory and CPUs (by default docker-machine creates a small VPS). For a full list of the flags/settings available and their defaults, see the output of docker-machine create -h.

When the creation of a host is initiated, a unique SSH key for accessing the host (initially for provisioning, then directly later if the user runs the docker-machine ssh command) will be created automatically and stored in the client's directory in ~/.docker/machines. After the creation of the SSH key, Docker will be installed on the remote machine and the daemon will be configured to accept remote connections over TCP using TLS for authentication. Once this is finished, the host is ready for connection.

And then from this point, the remote host behaves much like the local host we created in the last section. If we look at docker-machine, well see it is now the active host:

$ docker-machine active dev
$ docker-machine ls
NAME      ACTIVE   DRIVER         STATE     URL
dev                virtualbox     Running   tcp://192.168.99.103:2376
staging   *        digitalocean   Running   tcp://104.236.50.118:2376

To select an active host, you can use the docker-machine active command.

$ docker-machine active dev
$ docker-machine ls
NAME      ACTIVE   DRIVER         STATE     URL
dev       *        virtualbox     Running   tcp://192.168.99.103:2376
staging            digitalocean   Running   tcp://104.236.50.118:2376

To remove a host and all of its containers and images, use docker-machine rm:

$ docker-machine rm dev staging
$ docker-machine ls
NAME      ACTIVE   DRIVER       STATE     URL

Adding a host without a driver

You can add a host to Docker which only has a URL and no driver. Therefore it can be used an alias for an existing host so you dont have to type out the URL every time you run a Docker command.

$ docker-machine create --url=tcp://50.134.234.20:2376 custombox
$ docker-machine ls
NAME        ACTIVE   DRIVER    STATE     URL
custombox   *        none      Running   tcp://50.134.234.20:2376

Using Docker Machine with Docker Swarm

Docker Machine can also provision Swarm clusters. This can be used with any driver and will be secured with TLS.

Note: This is an experimental feature so the subcommands and options are likely to change in future versions.

First, create a Swarm token. Optionally, you can use another discovery service. See the Swarm docs for details.

To create the token, first create a Machine. This example will use VirtualBox.

$ docker-machine create -d virtualbox local

Load the Machine configuration into your shell:

$ $(docker-machine env local)

Then run generate the token using the Swarm Docker image:

$ docker run swarm create
1257e0f0bbb499b5cd04b4c9bdb2dab3

Once you have the token, you can create the cluster.

Swarm Master

Create the Swarm master:

docker-machine create \
    -d virtualbox \
    --swarm \
    --swarm-master \
    --swarm-discovery token://<TOKEN-FROM-ABOVE> \
    swarm-master

Replace <TOKEN-FROM-ABOVE> with your random token. This will create the Swarm master and add itself as a Swarm node.

Swarm Nodes

Now, create more Swarm nodes:

docker-machine create \
    -d virtualbox \
    --swarm \
    --swarm-discovery token://<TOKEN-FROM-ABOVE> \
    swarm-node-00

You now have a Swarm cluster across two nodes. To connect to the Swarm master, use docker-machine env --swarm swarm-master

For example:

$ docker-machine env --swarm swarm-master
export DOCKER_TLS_VERIFY=yes
export DOCKER_CERT_PATH=/home/ehazlett/.docker/machines/.client
export DOCKER_HOST=tcp://192.168.99.100:3376

You can load this into your environment using $(docker-machine env --swarm swarm-master).

Now you can use the Docker CLI to query:

$ docker info
Containers: 1
Nodes: 1
 swarm-master: 192.168.99.100:2376
  └ Containers: 2
  └ Reserved CPUs: 0 / 4
  └ Reserved Memory: 0 B / 999.9 MiB

Subcommands

active

Get or set the active machine.

$ docker-machine ls
NAME      ACTIVE   DRIVER         STATE     URL
dev                virtualbox     Running   tcp://192.168.99.103:2376
staging   *        digitalocean   Running   tcp://104.236.50.118:2376
$ docker-machine active dev
$ docker-machine ls
NAME      ACTIVE   DRIVER         STATE     URL
dev       *        virtualbox     Running   tcp://192.168.99.103:2376
staging            digitalocean   Running   tcp://104.236.50.118:2376

create

Create a machine.

$ docker-machine create --driver virtualbox dev
INFO[0000] Creating SSH key...
INFO[0000] Creating VirtualBox VM...
INFO[0007] Starting VirtualBox VM...
INFO[0007] Waiting for VM to start...
INFO[0038] "dev" has been created and is now the active machine. To point Docker at this machine, run: export DOCKER_HOST=$(docker-machine url) DOCKER_AUTH=identity

config

Show the Docker client configuration for a machine.

$ docker-machine config dev
--tls --tlscacert=/Users/ehazlett/.docker/machines/dev/ca.pem --tlscert=/Users/ehazlett/.docker/machines/dev/cert.pem --tlskey=/Users/ehazlett/.docker/machines/dev/key.pem -H tcp://192.168.99.103:2376

env

Set environment variables to dictate that docker should run a command against a particular machine.

docker-machine env machinename will print out export commands which can be run in a subshell. Running docker-machine env -u will print unset commands which reverse this effect.

$ env | grep DOCKER
$ $(docker-machine env dev)
$ env | grep DOCKER
DOCKER_HOST=tcp://192.168.99.101:2376
DOCKER_CERT_PATH=/Users/nathanleclaire/.docker/machines/.client
DOCKER_TLS_VERIFY=yes
$ # If you run a docker command, now it will run against that host.
$ $(docker-machine env -u)
$ env | grep DOCKER
$ # The environment variables have been unset.

inspect

Inspect information about a machine.

$ docker-machine inspect dev
{
    "DriverName": "virtualbox",
    "Driver": {
        "MachineName": "docker-host-128be8d287b2028316c0ad5714b90bcfc11f998056f2f790f7c1f43f3d1e6eda",
        "SSHPort": 55834,
        "Memory": 1024,
        "DiskSize": 20000,
        "Boot2DockerURL": ""
    }
}

help

Show help text.

ip

Get the IP address of a machine.

$ docker-machine ip
192.168.99.104

kill

Kill (abruptly force stop) a machine.

$ docker-machine ls
NAME   ACTIVE   DRIVER       STATE     URL
dev    *        virtualbox   Running   tcp://192.168.99.104:2376
$ docker-machine kill dev
$ docker-machine ls
NAME   ACTIVE   DRIVER       STATE     URL
dev    *        virtualbox   Stopped

ls

List machines.

$ docker-machine ls
NAME   ACTIVE   DRIVER       STATE     URL
dev             virtualbox   Stopped
foo0            virtualbox   Running   tcp://192.168.99.105:2376
foo1            virtualbox   Running   tcp://192.168.99.106:2376
foo2            virtualbox   Running   tcp://192.168.99.107:2376
foo3            virtualbox   Running   tcp://192.168.99.108:2376
foo4   *        virtualbox   Running   tcp://192.168.99.109:2376

restart

Restart a machine. Oftentimes this is equivalent to docker-machine stop; machine start.

$ docker-machine restart
INFO[0005] Waiting for VM to start...

rm

Remove a machine. This will remove the local reference as well as delete it on the cloud provider or virtualization management platform.

$ docker-machine ls
NAME   ACTIVE   DRIVER       STATE     URL
foo0            virtualbox   Running   tcp://192.168.99.105:2376
foo1            virtualbox   Running   tcp://192.168.99.106:2376
$ docker-machine rm foo1
$ docker-machine ls
NAME   ACTIVE   DRIVER       STATE     URL
foo0            virtualbox   Running   tcp://192.168.99.105:2376

ssh

Log into or run a command on a machine using SSH.

To login, just run docker-machine ssh machinename:

$ docker-machine ssh dev
                        ##        .
                  ## ## ##       ==
               ## ## ## ##      ===
           /""""""""""""""""\___/ ===
      ~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ /  ===- ~~~
           \______ o          __/
             \    \        __/
              \____\______/
 _                 _   ____     _            _
| |__   ___   ___ | |_|___ \ __| | ___   ___| | _____ _ __
| '_ \ / _ \ / _ \| __| __) / _` |/ _ \ / __| |/ / _ \ '__|
| |_) | (_) | (_) | |_ / __/ (_| | (_) | (__|   <  __/ |
|_.__/ \___/ \___/ \__|_____\__,_|\___/ \___|_|\_\___|_|
Boot2Docker version 1.4.0, build master : 69cf398 - Fri Dec 12 01:39:42 UTC 2014
docker@boot2docker:~$ ls /
Users/   dev/     home/    lib/     mnt/     proc/    run/     sys/     usr/
bin/     etc/     init     linuxrc  opt/     root/    sbin/    tmp      var/

You can also specify commands to run remotely by appending them directly to the docker-machine ssh command, much like the regular ssh program works:

$ docker-machine ssh dev free
             total         used         free       shared      buffers
Mem:       1023556       183136       840420            0        30920
-/+ buffers:             152216       871340
Swap:      1212036            0      1212036

If the command you are appending has flags, e.g. df -h, you can use the flag parsing terminator (--) to avoid confusing the docker-machine client, which will otherwise interpret them as flags you intended to pass to it:

$ docker-machine ssh dev -- df -h
Filesystem                Size      Used Available Use% Mounted on
rootfs                  899.6M     85.9M    813.7M  10% /
tmpfs                   899.6M     85.9M    813.7M  10% /
tmpfs                   499.8M         0    499.8M   0% /dev/shm
/dev/sda1                18.2G     58.2M     17.2G   0% /mnt/sda1
cgroup                  499.8M         0    499.8M   0% /sys/fs/cgroup
/dev/sda1                18.2G     58.2M     17.2G   0%
/mnt/sda1/var/lib/docker/aufs

start

Gracefully start a machine.

$ docker-machine restart
INFO[0005] Waiting for VM to start...

stop

Gracefully stop a machine.

$ docker-machine ls
NAME   ACTIVE   DRIVER       STATE     URL
dev    *        virtualbox   Running   tcp://192.168.99.104:2376
$ docker-machine stop dev
$ docker-machine ls
NAME   ACTIVE   DRIVER       STATE     URL
dev    *        virtualbox   Stopped

upgrade

Upgrade a machine to the latest version of Docker.

$ docker-machine upgrade dev

url

Get the URL of a host

$ docker-machine url
tcp://192.168.99.109:2376

Drivers

TODO: List all possible values (where applicable) for all flags for every driver.

Amazon Web Services

Create machines on Amazon Web Services. You will need an Access Key ID, Secret Access Key and a VPC ID. To find the VPC ID, login to the AWS console and go to Services -> VPC -> Your VPCs. Select the one where you would like to launch the instance.

Options:

  • --amazonec2-access-key: required Your access key id for the Amazon Web Services API.
  • --amazonec2-ami: The AMI ID of the instance to use Default: ami-4ae27e22
  • --amazonec2-instance-type: The instance type to run. Default: t2.micro
  • --amazonec2-region: The region to use when launching the instance. Default: us-east-1
  • --amazonec2-root-size: The root disk size of the instance (in GB). Default: 16
  • --amazonec2-secret-key: required Your secret access key for the Amazon Web Services API.
  • --amazonec2-security-group: AWS VPC security group name. Default: docker-machine
  • --amazonec2-session-token: Your session token for the Amazon Web Services API.
  • --amazonec2-subnet-id: AWS VPC subnet id
  • --amazonec2-vpc-id: required Your VPC ID to launch the instance in.
  • --amazonec2-zone: The AWS zone launch the instance in (i.e. one of a,b,c,d,e). Default: a

By default, the Amazon EC2 driver will use a daily image of Ubuntu 14.04 LTS.

Region AMI ID
ap-northeast-1 ami-44f1e245
ap-southeast-1 ami-f95875ab
ap-southeast-2 ami-890b62b3
cn-north-1 ami-fe7ae8c7
eu-west-1 ami-823686f5
eu-central-1 ami-ac1524b1
sa-east-1 ami-c770c1da
us-east-1 ami-4ae27e22
us-west-1 ami-d1180894
us-west-2 ami-898dd9b9
us-gov-west-1 ami-cf5630ec

Digital Ocean

Create Docker machines on Digital Ocean.

You need to create a personal access token under "Apps & API" in the Digital Ocean Control Panel and pass that to docker-machine create with the --digitalocean-access-token option.

$ docker-machine create --driver digitalocean --digitalocean-access-token=aa9399a2175a93b17b1c86c807e08d3fc4b79876545432a629602f61cf6ccd6b test-this

Options:

  • --digitalocean-access-token: Your personal access token for the Digital Ocean API.
  • --digitalocean-image: The name of the Digital Ocean image to use. Default: docker
  • --digitalocean-region: The region to create the droplet in, see Regions API for how to get a list. Default: nyc3
  • --digitalocean-size: The size of the Digital Ocean driver (larger than default options are of the form 2gb). Default: 512mb

The DigitalOcean driver will use ubuntu-14-04-x64 as the default image.

Google Compute Engine

Create machines on Google Compute Engine. You will need a Google account and project name. See https://cloud.google.com/compute/docs/projects for details on projects.

The Google driver uses oAuth. When creating the machine, you will have your browser opened to authorize. Once authorized, paste the code given in the prompt to launch the instance.

Options:

  • --google-zone: The zone to launch the instance. Default: us-central1-a
  • --google-machine-type: The type of instance. Default: f1-micro
  • --google-username: The username to use for the instance. Default: docker-user
  • --google-instance-name: The name of the instance. Default: docker-machine
  • --google-project: The name of your project to use when launching the instance.

The GCE driver will use the ubuntu-1404-trusty-v20141212 instance type unless otherwise specified.

IBM Softlayer

Create machines on Softlayer.

You need to generate an API key in the softlayer control panel. Retrieve your API key

Options:

  • --softlayer-api-endpoint=: Change softlayer API endpoint
  • --softlayer-user: required username for your softlayer account, api key needs to match this user.
  • --softlayer-api-key: required API key for your user account
  • --softlayer-cpu: Number of CPU's for the machine.
  • --softlayer-disk-size: Size of the disk in MB. 0` sets the softlayer default.
  • --softlayer-domain: required domain name for the machine
  • --softlayer-hostname: hostname for the machine
  • --softlayer-hourly-billing: Sets the hourly billing flag (default), otherwise uses monthly billing
  • --softlayer-image: OS Image to use
  • --softlayer-local-disk: Use local machine disk instead of softlayer SAN.
  • --softlayer-memory: Memory for host in MB
  • --softlayer-private-net-only: Disable public networking
  • --softlayer-region: softlayer region

The SoftLayer driver will use UBUNTU_LATEST as the image type by default.

Microsoft Azure

Create machines on Microsoft Azure.

You need to create a subscription with a cert. Run these commands and answer the questions:

$ openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout mycert.pem -out mycert.pem
$ openssl pkcs12 -export -out mycert.pfx -in mycert.pem -name "My Certificate"
$ openssl x509 -inform pem -in mycert.pem -outform der -out mycert.cer

Go to the Azure portal, go to the "Settings" page (you can find the link at the bottom of the left sidebar - you need to scroll), then "Management Certificates" and upload mycert.cer.

Grab your subscription ID from the portal, then run docker-machine create with these details:

$ docker-machine create -d azure --azure-subscription-id="SUB_ID" --azure-subscription-cert="mycert.pem" A-VERY-UNIQUE-NAME

Options:

  • --azure-subscription-id: Your Azure subscription ID (A GUID like d255d8d7-5af0-4f5c-8a3e-1545044b861e).
  • --azure-subscription-cert: Your Azure subscription cert.

The Azure driver uses the b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-14_04_1-LTS-amd64-server-20140927-en-us-30GB image by default. Note, this image is not available in the Chinese regions. In China you should specify b549f4301d0b4295b8e76ceb65df47d4__Ubuntu-14_04_1-LTS-amd64-server-20140927-en-us-30GB.

You may need to machine ssh in to the virtual machine and reboot to ensure that the OS is updated.

Microsoft Hyper-V

Creates a Boot2Docker virtual machine locally on your Windows machine using Hyper-V. See here for instructions to enable Hyper-V. You will need to use an Administrator level account to create and manage Hyper-V machines.

Note: You will need an existing virtual switch to use the driver. Hyper-V can share an external network interface (aka bridging), see this blog. If you would like to use NAT, create an internal network, and use Internet Connection Sharing.

Options:

  • --hyper-v-boot2docker-location: Location of a local boot2docker iso to use. Overrides the URL option below.
  • --hyper-v-boot2docker-url: The URL of the boot2docker iso. Defaults to the latest available version.
  • --hyper-v-disk-size: Size of disk for the host in MB. Defaults to 20000.
  • --hyper-v-memory: Size of memory for the host in MB. Defaults to 1024. The machine is setup to use dynamic memory.
  • --hyper-v-virtual-switch: Name of the virtual switch to use. Defaults to first found.

Openstack

Create machines on Openstack

Mandatory:

  • --openstack-flavor-id: The flavor ID to use when creating the machine
  • --openstack-image-id: The image ID to use when creating the machine.

Options:

  • --openstack-auth-url: Keystone service base URL.
  • --openstack-username: User identifer to authenticate with.
  • --openstack-password: User password. It can be omitted if the standard environment variable OS_PASSWORD is set.
  • --openstack-tenant-name or --openstack-tenant-id: Identify the tenant in which the machine will be created.
  • --openstack-region: The region to work on. Can be omitted if there is ony one region on the OpenStack.
  • --openstack-endpoint-type: Endpoint type can be internalURL, adminURL on publicURL. If is a helper for the driver to choose the right URL in the OpenStack service catalog. If not provided the default id publicURL
  • --openstack-net-id: The private network id the machine will be connected on. If your OpenStack project project contains only one private network it will be use automatically.
  • --openstack-sec-groups: If security groups are available on your OpenStack you can specify a comma separated list to use for the machine (e.g. secgrp001,secgrp002).
  • --openstack-floatingip-pool: The IP pool that will be used to get a public IP an assign it to the machine. If there is an IP address already allocated but not assigned to any machine, this IP will be chosen and assigned to the machine. If there is no IP address already allocated a new IP will be allocated and assigned to the machine.
  • --openstack-ssh-user: The username to use for SSH into the machine. If not provided root will be used.
  • --openstack-ssh-port: Customize the SSH port if the SSH server on the machine does not listen on the default port.

Environment variables:

Here comes the list of the supported variables with the corresponding options. If both environment variable and CLI option are provided the CLI option takes the precedence.

Environment variable CLI option
OS_AUTH_URL --openstack-auth-url
OS_USERNAME --openstack-username
OS_PASSWORD --openstack-password
OS_TENANT_NAME --openstack-tenant-name
OS_TENANT_ID --openstack-tenant-id
OS_REGION_NAME --openstack-region
OS_ENDPOINT_TYPE --openstack-endpoint-type

Rackspace

Create machines on Rackspace cloud

Options:

  • --rackspace-username: Rackspace account username
  • --rackspace-api-key: Rackspace API key
  • --rackspace-region: Rackspace region name
  • --rackspace-endpoint-type: Rackspace endpoint type (adminURL, internalURL or the default publicURL)
  • --rackspace-image-id: Rackspace image ID. Default: Ubuntu 14.10 (Utopic Unicorn) (PVHVM)
  • --rackspace-flavor-id: Rackspace flavor ID. Default: General Purpose 1GB
  • --rackspace-ssh-user: SSH user for the newly booted machine. Set to root by default
  • --rackspace-ssh-port: SSH port for the newly booted machine. Set to 22 by default

Environment variables:

Here comes the list of the supported variables with the corresponding options. If both environment variable and CLI option are provided the CLI option takes the precedence.

Environment variable CLI option
OS_USERNAME --rackspace-username
OS_API_KEY --rackspace-ap-key
OS_REGION_NAME --rackspace-region
OS_ENDPOINT_TYPE --rackspace-endpoint-type

The Rackspace driver will use 598a4282-f14b-4e50-af4c-b3e52749d9f9 (Ubuntu 14.04 LTS) by default.

Oracle VirtualBox

Create machines locally using VirtualBox. This driver requires VirtualBox to be installed on your host.

$ docker-machine create --driver=virtualbox vbox-test

Options:

  • --virtualbox-boot2docker-url: The URL of the boot2docker image. Defaults to the latest available version.
  • --virtualbox-disk-size: Size of disk for the host in MB. Default: 20000
  • --virtualbox-memory: Size of memory for the host in MB. Default: 1024

The VirtualBox driver uses the latest boot2docker image.

VMware Fusion

Creates machines locally on VMware Fusion. Requires VMware Fusion to be installed.

Options:

  • --vmwarefusion-boot2docker-url: URL for boot2docker image.
  • --vmwarefusion-disk-size: Size of disk for host VM (in MB). Default: 20000
  • --vmwarefusion-memory-size: Size of memory for host VM (in MB). Default: 1024

The VMware Fusion driver uses the latest boot2docker image.

VMware vCloud Air

Creates machines on vCloud Air subscription service. You need an account within an existing subscription of vCloud Air VPC or Dedicated Cloud.

Options:

  • --vmwarevcloudair-username: vCloud Air Username.
  • --vmwarevcloudair-password: vCloud Air Password.
  • --vmwarevcloudair-catalog: Catalog. Default: Public Catalog
  • --vmwarevcloudair-catalogitem: Catalog Item. Default: Ubuntu Server 12.04 LTS (amd64 20140927)
  • --vmwarevcloudair-computeid: Compute ID (if using Dedicated Cloud).
  • --vmwarevcloudair-cpu-count: VM Cpu Count. Default: 1
  • --vmwarevcloudair-docker-port: Docker port. Default: 2376
  • --vmwarevcloudair-edgegateway: Organization Edge Gateway. Default: <vdcid>
  • --vmwarevcloudair-memory-size: VM Memory Size in MB. Default: 2048
  • --vmwarevcloudair-name: vApp Name. Default: <autogenerated>
  • --vmwarevcloudair-orgvdcnetwork: Organization VDC Network to attach. Default: <vdcid>-default-routed
  • --vmwarevcloudair-provision: Install Docker binaries. Default: true
  • --vmwarevcloudair-publicip: Org Public IP to use.
  • --vmwarevcloudair-ssh-port: SSH port. Default: 22
  • --vmwarevcloudair-vdcid: Virtual Data Center ID.

The VMware vCloud Air driver will use the Ubuntu Server 12.04 LTS (amd64 20140927) image by default.

VMware vSphere

Creates machines on a VMware vSphere Virtual Infrastructure. Requires a working vSphere (ESXi and optionally vCenter) installation. The vSphere driver depends on govc (must be in path) and has been tested with vmware/govmomi@c848630.

Options:

  • --vmwarevsphere-username: vSphere Username.
  • --vmwarevsphere-password: vSphere Password.
  • --vmwarevsphere-boot2docker-url: URL for boot2docker image.
  • --vmwarevsphere-compute-ip: Compute host IP where the Docker VM will be instantiated.
  • --vmwarevsphere-cpu-count: CPU number for Docker VM. Default: 2
  • --vmwarevsphere-datacenter: Datacenter for Docker VM (must be set to ha-datacenter when connecting to a single host).
  • --vmwarevsphere-datastore: Datastore for Docker VM.
  • --vmwarevsphere-disk-size: Size of disk for Docker VM (in MB). Default: 20000
  • --vmwarevsphere-memory-size: Size of memory for Docker VM (in MB). Default: 2048
  • --vmwarevsphere-network: Network where the Docker VM will be attached.
  • --vmwarevsphere-pool: Resource pool for Docker VM.
  • --vmwarevsphere-vcenter: IP/hostname for vCenter (or ESXi if connecting directly to a single host).

The VMware vSphere driver uses the latest boot2docker image.