Compare commits

..

1 Commits

Author SHA1 Message Date
Evan Hazlett
6f939a8d67 bump: version 0.3.0-rc2
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-06-06 18:34:35 -04:00
15 changed files with 139 additions and 321 deletions

View File

@@ -24,8 +24,3 @@ Machine currently supports running Boot2Docker for "local" providers and Ubuntu
### Windows Experience
Currently, the Machine on Windows experience is not as good as the Mac / Linux. There is no "recommended" path to use Machine and there are several inconsistencies on Windows such as logging and output formatting.
Project Planning
================
An [Open-Source Planning Process](https://github.com/docker/machine/wiki/Open-Source-Planning-Process) is used to define the Roadmap. [Project Pages](https://github.com/docker/machine/wiki) define the goals for each Milestone and identify current progress.

View File

@@ -652,18 +652,14 @@ func getCertPathInfo(c *cli.Context) libmachine.CertPathInfo {
}
func detectShell() (string, error) {
// check for windows env and not bash (i.e. msysgit, etc)
// the SHELL env var is not set for processes in msysgit; we check
// for TERM instead
if runtime.GOOS == "windows" && os.Getenv("TERM") != "cygwin" {
// attempt to get the SHELL env var
shell := filepath.Base(os.Getenv("SHELL"))
// none detected; check for windows env and not bash (i.e. msysgit, etc)
if runtime.GOOS == "windows" && shell == "" {
log.Printf("On Windows, please specify either 'cmd' or 'powershell' with the --shell flag.\n\n")
return "", ErrUnknownShell
}
// attempt to get the SHELL env var
shell := filepath.Base(os.Getenv("SHELL"))
log.Debugf("shell: %s", shell)
if shell == "" {
return "", ErrUnknownShell
}

View File

@@ -1,5 +1,3 @@
# Migrate from Boot2Docker CLI to Docker Machine
This guide explains migrating from the Boot2Docker CLI to Docker Machine.
This guide assumes basic knowledge of the Boot2Docker CLI and Docker Machine. If you are not familiar, please review those docs prior to migrating.

View File

@@ -40,7 +40,7 @@ For more information and resources, please visit
## Installation
Docker Machine is supported on Windows, OS X, and Linux and is installable as one
standalone binary. The links to the binaries for the various platforms and
standalone binary. The links to the binaries for the various platforms and
architectures are below:
- [Windows - 32bit](https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_windows-386.exe)
@@ -50,11 +50,11 @@ architectures are below:
- [Linux - x86_64](https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_linux-amd64)
- [Linux - i386](https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_linux-386)
### OS X and Linux
### OSX and Linux
To install on OS X or Linux, download the proper binary to somewhere in your
`PATH` (e.g. `/usr/local/bin`) and make it executable. For instance, to install on
most OS X machines these commands should suffice:
To install on OSX or Linux, download the proper binary to somewhere in your
`PATH` (e.g. `/usr/local/bin`) and make it executable. For instance, to install on
most OSX machines these commands should suffice:
```
$ curl -L https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_darwin-amd64 > /usr/local/bin/docker-machine
@@ -80,13 +80,13 @@ $ curl -L https://get.docker.com/builds/Darwin/x86_64/docker-latest > /usr/local
### Windows
Currently, Docker recommends that you install and use Docker Machine on Windows
with [msysgit](https://msysgit.github.io/). This will provide you with some
with [msysgit](https://msysgit.github.io/). This will provide you with some
programs that Docker Machine relies on such as `ssh`, as well as a functioning
shell.
When you have installed msysgit, start up the terminal prompt and run the
following commands. Here it is assumed that you are on a 64-bit Windows
installation. If you are on a 32-bit installation, please substitute "i386" for
following commands. Here it is assumed that you are on a 64-bit Windows
installation. If you are on a 32-bit installation, please substitute "i386" for
"x86_64" in the URLs mentioned.
First, install the Docker client binary:
@@ -126,7 +126,7 @@ 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
`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 command will download a lightweight Linux distribution
@@ -154,8 +154,8 @@ dev virtualbox Running tcp://192.168.99.100:2376
```
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 env`
command. For example,
Docker to talk to that machine. You can do this with the `docker-machine env`
command. For example,
```
$ eval "$(docker-machine env dev)"
@@ -163,7 +163,7 @@ $ docker ps
```
> **Note**: If you are using `fish`, or a Windows shell such as
> Powershell/`cmd.exe` the above method will not work as described. Instead,
> Powershell/`cmd.exe` the above method will not work as described. Instead,
> see [the `env` command's documentation](https://docs.docker.com/machine/#env)
> to learn how to set the environment variables for your shell.
@@ -212,7 +212,7 @@ $ docker run -d -p 8000:80 nginx
```
When the image is finished pulling, you can hit the server at port 8000 on the
IP address given to you by `docker-machine ip`. For instance:
IP address given to you by `docker-machine ip`. For instance:
```
$ curl $(docker-machine ip dev):8000
@@ -244,7 +244,7 @@ Commercial support is available at
```
You can create and manage as many local VMs running Docker as you please- just
run `docker-machine create` again. All created machines will appear in the
run `docker-machine create` again. All created machines will appear in the
output of `docker-machine ls`.
If you are finished using a host for the time being, you can stop it with
@@ -259,16 +259,16 @@ $ docker-machine start dev
## Using Docker Machine with a cloud provider
Creating a local virtual machine running Docker is useful and fun, but it is not
the only thing Docker Machine is capable of. Docker Machine supports several
the only thing Docker Machine is capable of. Docker Machine supports several
“drivers” which let you use the same interface to create hosts on many different
cloud or local virtualization platforms. This is accomplished by using the
`docker-machine create` command with the `--driver` flag. Here we will be
cloud or local virtualization platforms. This is accomplished by using the
`docker-machine create` command with the `--driver` flag. Here we will be
demonstrating the [Digital Ocean](https://digitalocean.com) 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.
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.
@@ -302,18 +302,18 @@ INFO[0085] To see how to connect Docker to this machine, run: docker-machine env
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
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
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,
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
to accept remote connections over TCP using TLS for authentication. Once this
is finished, the host is ready for connection.
To prepare the Docker client to send commands to the remote server we have
@@ -324,7 +324,7 @@ $ eval "$(docker-machine env staging)"
```
From this point, the remote host behaves much like the local host we created in
the last section. If we look at `docker-machine ls`, we'll see it is now the
the last section. If we look at `docker-machine ls`, we'll see it is now the
"active" host, indicated by an asterisk (`*`) in that column:
```
@@ -359,10 +359,10 @@ custombox * none Running tcp://50.134.234.20:2376
Docker Machine can also provision [Swarm](https://github.com/docker/swarm)
clusters. This can be used with any driver and will be secured with TLS.
First, create a Swarm token. Optionally, you can use another discovery service.
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.
To create the token, first create a Machine. This example will use VirtualBox.
```
$ docker-machine create -d virtualbox local
@@ -382,7 +382,7 @@ $ docker run swarm create
```
Once you have the token, you can create the cluster.
### Swarm master
### Swarm Master
Create the Swarm master:
@@ -398,7 +398,7 @@ docker-machine create \
Replace `<TOKEN-FROM-ABOVE>` with your random token.
This will create the Swarm master and add itself as a Swarm node.
### Swarm nodes
### Swarm Nodes
Now, create more Swarm nodes:
@@ -481,7 +481,7 @@ $ docker-machine create -h | wc -l
While it is great to have access to all this information, sometimes you simply
want to get a peek at the subset of flags which are applicable to the driver you
are working with. To that extent, specifying an argument to the `-d` flag will
are working with. To that extent, specifying an argument to the `-d` flag will
filter the create flags displayed in the help text to only what is applicable to
that provider:
@@ -513,21 +513,21 @@ Options:
##### Specifying configuration options for the created Docker engine
As part of the process of creation, Docker Machine installs Docker and
configures it with some sensible defaults. For instance, it allows connection
configures it with some sensible defaults. For instance, it allows connection
from the outside world over TCP with TLS-based encryption and defaults to AUFS
as the [storage
driver](https://docs.docker.com/reference/commandline/cli/#daemon-storage-driver-option)
when available.
There are several cases where the user might want to set options for the created
Docker engine (also known as the Docker _daemon_) themselves. For example, they
Docker engine (also known as the Docker _daemon_) themselves. For example, they
may want to allow connection to a [registry](https://docs.docker.com/registry/)
that they are running themselves using the `--insecure-registry` flag for the
daemon. Docker Machine supports the configuration of such options for the
daemon. Docker Machine supports the configuration of such options for the
created engines via the `create` command flags which begin with `--engine`.
Note that Docker Machine simply sets the configured parameters on the daemon
and does not set up any of the "dependencies" for you. For instance, if you
and does not set up any of the "dependencies" for you. For instance, if you
specify that the created daemon should use `btrfs` as a storage driver, you
still must ensure that the proper dependencies are installed, the BTRFS
filesystem has been created, and so on.
@@ -546,7 +546,7 @@ $ docker-machine create -d virtualbox \
This will create a virtual machine running locally in Virtualbox which uses the
`devicemapper` storage backend, has the key-value pairs `foo=bar` and
`spam=eggs` as labels on the engine, and allows pushing / pulling from the
insecure registry located at `registry.myco.com`. You can verify much of this
insecure registry located at `registry.myco.com`. You can verify much of this
by inspecting the output of `docker info`:
```
@@ -589,22 +589,22 @@ $ docker-machine create -d virtualbox \
gdns
```
##### Specifying Docker Swarm options for the created machine
##### Specifying Swarm options for the created machine
In addition to being able to configure Docker Engine options as listed above,
you can use Machine to specify how the created Swarm master should be
configured). There is a `--swarm-strategy` flag, which you can use to specify
configured). There is a `--swarm-strategy` flag, which you can use to specify
the [scheduling strategy](https://docs.docker.com/swarm/scheduler/strategy/)
which Docker Swarm should use (Machine defaults to the `spread` strategy).
There is also a general purpose `--swarm-opt` option which works similar to how
the aforementioned `--engine-opt` option does, except that it specifies options
for the `swarm manage` command (used to boot a master node) instead of the base
command. You can use this to configure features that power users might be
command. You can use this to configure features that power users might be
interested in, such as configuring the heartbeat interval or Swarm's willingness
to over-commit resources.
If you're not sure how to configure these options, it is best to not specify
configuration at all. Docker Machine will choose sensible defaults for you and
configuration at all. Docker Machine will choose sensible defaults for you and
you won't have to worry about it.
Example create:
@@ -638,7 +638,7 @@ 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
run in a subshell. Running `docker-machine env -u` will print `unset` commands
which reverse this effect.
```
@@ -657,7 +657,7 @@ $ # The environment variables have been unset.
The output described above is intended for the shells `bash` and `zsh` (if
you're not sure which shell you're using, there's a very good possibility that
it's `bash`). However, these are not the only shells which Docker Machine
it's `bash`). However, these are not the only shells which Docker Machine
supports.
If you are using `fish` and the `SHELL` environment variable is correctly set to
@@ -675,7 +675,7 @@ set -x DOCKER_MACHINE_NAME overlay
If you are on Windows and using Powershell or `cmd.exe`, `docker-machine env`
cannot detect your shell automatically, but it does have support for these
shells. In order to use them, specify which shell you would like to print the
shells. In order to use them, specify which shell you would like to print the
options for using the `--shell` flag for `docker-machine env`.
For Powershell:
@@ -875,7 +875,7 @@ INFO[0013] Regenerating TLS certificates
#### restart
Restart a machine. Oftentimes this is equivalent to
Restart a machine. Oftentimes this is equivalent to
`docker-machine stop; machine start`.
```
@@ -885,7 +885,7 @@ INFO[0005] Waiting for VM to start...
#### rm
Remove a machine. This will remove the local reference as well as delete it
Remove a machine. This will remove the local reference as well as delete it
on the cloud provider or virtualization management platform.
```
@@ -958,15 +958,15 @@ cgroup 499.8M 0 499.8M 0% /sys/fs/cgroup
When Docker Machine is invoked, it will check to see if you have the venerable
`ssh` binary around locally and will attempt to use that for the SSH commands it
needs to run, whether they are a part of an operation such as creation or have
been requested by the user directly. If it does not find an external `ssh`
been requested by the user directly. If it does not find an external `ssh`
binary locally, it will default to using a native Go implementation from
[crypto/ssh](https://godoc.org/golang.org/x/crypto/ssh). This is useful in
[crypto/ssh](https://godoc.org/golang.org/x/crypto/ssh). This is useful in
situations where you may not have access to traditional UNIX tools, such as if
you are using Docker Machine on Windows without having msysgit installed
alongside of it.
In most situations, you will not have to worry about this implementation detail
and Docker Machine will act sensibly out of the box. However, if you
and Docker Machine will act sensibly out of the box. However, if you
deliberately want to use the Go native version, you can do so with a global
command line flag / environment variable like so:
@@ -1029,9 +1029,9 @@ dev * virtualbox Stopped
#### upgrade
Upgrade a machine to the latest version of Docker. If the machine uses Ubuntu
Upgrade a machine to the latest version of Docker. If the machine uses Ubuntu
as the underlying operating system, it will upgrade the package `lxc-docker`
(our recommended install method). If the machine uses boot2docker, this command
(our recommended install method). If the machine uses boot2docker, this command
will download the latest boot2docker ISO and replace the machine's existing ISO
with the latest.
@@ -1061,7 +1061,7 @@ tcp://192.168.99.109:2376
## Drivers
#### Amazon Web Services
Create machines on [Amazon Web Services](http://aws.amazon.com). 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.
Create machines on [Amazon Web Services](http://aws.amazon.com). 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:
@@ -1198,7 +1198,7 @@ Options:
- `--generic-ssh-key`: Path to the SSH user private key.
- `--generic-ssh-port`: Port to use for SSH.
> **Note**: You must use a base operating system supported by Machine.
> Note: you must use a base Operating System supported by Machine.
Environment variables and default values:
@@ -1210,9 +1210,9 @@ Environment variables and default values:
| `--generic-ssh-port` | - | `22` |
#### Google Compute Engine
Create machines on [Google Compute Engine](https://cloud.google.com/compute/). You will need a Google account and project name. See https://cloud.google.com/compute/docs/projects for details on projects.
Create machines on [Google Compute Engine](https://cloud.google.com/compute/). 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.
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:
@@ -1338,12 +1338,12 @@ Environment variables and default values:
#### Microsoft Hyper-V
Creates a Boot2Docker virtual machine locally on your Windows machine
using Hyper-V. [See here](http://windows.microsoft.com/en-us/windows-8/hyper-v-run-virtual-machines)
using Hyper-V. [See here](http://windows.microsoft.com/en-us/windows-8/hyper-v-run-virtual-machines)
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
> driver. Hyper-V can share an external network interface (aka
> bridging), see [this blog](http://blogs.technet.com/b/canitpro/archive/2014/03/11/step-by-step-enabling-hyper-v-for-use-on-windows-8-1.aspx).
> If you would like to use NAT, create an internal network, and use
> [Internet Connection
@@ -1384,7 +1384,6 @@ Options:
- `--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 only one region on the OpenStack.
- `--openstack-availability-zone`: The availability zone in which to launch the server.
- `--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-name` or `--openstack-net-id`: Identify the private network the machine will be connected on. If your OpenStack project project contains only one private network it will be use automatically.
@@ -1398,29 +1397,28 @@ Options:
Environment variables and default values:
| CLI option | Environment variable | Default |
|----------------------------------|------------------------|---------|
| `--openstack-auth-url` | `OS_AUTH_URL` | - |
| `--openstack-flavor-name` | - | - |
| `--openstack-flavor-id` | - | - |
| `--openstack-image-name` | - | - |
| `--openstack-image-id` | - | - |
| `--openstack-insecure` | - | - |
| `--openstack-domain-name` | `OS_DOMAIN_NAME` | - |
| `--openstack-domain-id` | `OS_DOMAIN_ID` | - |
| `--openstack-username` | `OS_USERNAME` | - |
| `--openstack-password` | `OS_PASSWORD` | - |
| `--openstack-tenant-name` | `OS_TENANT_NAME` | - |
| `--openstack-tenant-id` | `OS_TENANT_ID` | - |
| `--openstack-region` | `OS_REGION_NAME` | - |
| `--openstack-availability-zone` | `OS_AVAILABILITY_ZONE` | - |
| `--openstack-endpoint-type` | `OS_ENDPOINT_TYPE` | - |
| `--openstack-net-name` | - | - |
| `--openstack-net-id` | - | - |
| `--openstack-sec-groups` | - | - |
| `--openstack-floatingip-pool` | - | - |
| `--openstack-ssh-user` | - | `root` |
| `--openstack-ssh-port` | - | `22` |
| CLI option | Environment variable | Default |
|-------------------------------|----------------------|---------|
| `--openstack-auth-url` | `OS_AUTH_URL` | - |
| `--openstack-flavor-name` | - | - |
| `--openstack-flavor-id` | - | - |
| `--openstack-image-name` | - | - |
| `--openstack-image-id` | - | - |
| `--openstack-insecure` | - | - |
| `--openstack-domain-name` | `OS_DOMAIN_NAME` | - |
| `--openstack-domain-id` | `OS_DOMAIN_ID` | - |
| `--openstack-username` | `OS_USERNAME` | - |
| `--openstack-password` | `OS_PASSWORD` | - |
| `--openstack-tenant-name` | `OS_TENANT_NAME` | - |
| `--openstack-tenant-id` | `OS_TENANT_ID` | - |
| `--openstack-region` | `OS_REGION_NAME` | - |
| `--openstack-endpoint-type` | `OS_ENDPOINT_TYPE` | - |
| `--openstack-net-name` | - | - |
| `--openstack-net-id` | - | - |
| `--openstack-sec-groups` | - | - |
| `--openstack-floatingip-pool` | - | - |
| `--openstack-ssh-user` | - | `root` |
| `--openstack-ssh-port` | - | `22` |
#### Rackspace
Create machines on [Rackspace cloud](http://www.rackspace.com/cloud)
@@ -1458,13 +1456,6 @@ Create machines locally using [VirtualBox](https://www.virtualbox.org/).
This driver requires VirtualBox to be installed on your host.
$ docker-machine create --driver=virtualbox vbox-test
You can create an entirely new machine or you can convert a Boot2Docker VM into
a machine by importing the VM. To convert a Boot2Docker VM, you'd use the following
command:
$ docker-machine create -d virtualbox --virtualbox-import-boot2docker-vm boot2docker-vm b2d
Options:
@@ -1473,14 +1464,13 @@ Options:
- `--virtualbox-disk-size`: Size of disk for the host in MB.
- `--virtualbox-boot2docker-url`: The URL of the boot2docker image. Defaults to the latest available version.
- `--virtualbox-import-boot2docker-vm`: The name of a Boot2Docker VM to import.
- `--virtualbox-hostonly-cidr`: The CIDR of the host only adapter.
The `--virtualbox-boot2docker-url` flag takes a few different forms. By
The `--virtualbox-boot2docker-url` flag takes a few different forms. By
default, if no value is specified for this flag, Machine will check locally for
a boot2docker ISO. If one is found, that will be used as the ISO for the
created machine. If one is not found, the latest ISO release available on
a boot2docker ISO. If one is found, that will be used as the ISO for the
created machine. If one is not found, the latest ISO release available on
[boot2docker/boot2docker](https://github.com/boot2docker/boot2docker) will be
downloaded and stored locally for future use. Note that this means you must run
downloaded and stored locally for future use. Note that this means you must run
`docker-machine upgrade` deliberately on a machine if you wish to update the "cached"
boot2docker ISO.
@@ -1489,18 +1479,9 @@ option also supports specifying ISOs by the `http://` and `file://` protocols.
`file://` will look at the path specified locally to locate the ISO: for
instance, you could specify `--virtualbox-boot2docker-url
file://$HOME/Downloads/rc.iso` to test out a release candidate ISO that you have
downloaded already. You could also just get an ISO straight from the Internet
downloaded already. You could also just get an ISO straight from the Internet
using the `http://` form.
To customize the host only adapter, you can use the `--virtualbox-hostonly-cidr`
flag. This will specify the host IP and Machine will calculate the VirtualBox
DHCP server address (a random IP on the subnet between `.1` and `.25`) so
it does not clash with the specified host IP.
Machine will also specify the DHCP lower bound to `.100` and the upper bound
to `.254`. For example, a specified CIDR of `192.168.24.1/24` would have a
DHCP server between `192.168.24.2-25`, a lower bound of `192.168.24.100` and
upper bound of `192.168.24.254`.
Environment variables and default values:
| CLI option | Environment variable | Default |
@@ -1510,7 +1491,6 @@ Environment variables and default values:
| `--virtualbox-disk-size` | `VIRTUALBOX_DISK_SIZE` | `20000` |
| `--virtualbox-boot2docker-url` | `VIRTUALBOX_BOOT2DOCKER_URL` | *Latest boot2docker url* |
| `--virtualbox-import-boot2docker-vm` | - | `boot2docker-vm` |
| `--virtualbox-hostonly-cidr` | `VIRTUALBOX_HOSTONLY_CIDR` | `192.168.99.1/24` |
#### VMware Fusion
Creates machines locally on [VMware Fusion](http://www.vmware.com/products/fusion). Requires VMware Fusion to be installed.
@@ -1522,7 +1502,7 @@ Options:
- `--vmwarefusion-disk-size`: Size of disk for host VM (in MB).
- `--vmwarefusion-memory-size`: Size of memory for host VM (in MB).
The VMware Fusion driver uses the latest boot2docker image.
The VMware Fusion driver uses the latest boot2docker image.
See [frapposelli/boot2docker](https://github.com/frapposelli/boot2docker/tree/vmware-64bit)
Environment variables and default values:
@@ -1612,12 +1592,11 @@ Environment variables and default values:
| `--vmwarevsphere-pool` | `VSPHERE_POOL` | - |
| `--vmwarevsphere-compute-ip` | `VSPHERE_COMPUTE_IP` | - |
## Specify a base operating systems
The Machine provisioning system supports several base operating systems. For
local providers such as VirtualBox, Fusion, Hyper-V, and so forth, the default
base operating system is Boot2Docker. For cloud providers, the base operating
system is the latest Ubuntu LTS the provider supports.
## Base Operating Systems
The Machine provisioning system supports several base operating systems.
The default base operating system is Boot2Docker on local providers
(VirtualBox, Fusion, Hyper-V, etc) and the latest Ubuntu LTS supported
by the cloud provider.
| Operating System | Version | Notes |
|----------------------------|------------------|-------------------------|
@@ -1629,13 +1608,12 @@ system is the latest Ubuntu LTS the provider supports.
| CentOS | 7+ | experimental |
| Fedora | 21+ | experimental |
To use a different base operating system on a remote provider, specify the
provider's image flag and one of its available images. For example, to
select a `debian-8-x64` image on DigitalOcean you would supply the following:
If you want to use a different base operating system on a remote provider,
you will need to select the image accordingly for that provider. For
example, on DigitalOcean you would use the `--digitalocean-image` flag.
For Amazon AWS, you would use the `--amazonec2-ami` flag.
--digitalocean-image=debian-8-x64`
If you change the base image for a provider, you may also need to change
the SSH user. For example, the default Red Hat AMI on EC2 expects the
SSH user to be `ec2-user`, so you would have to specify this with
> Note: if you change the base image for a provider you may also need to change
the SSH user as well. For example, the default Red Hat AMI on EC2 expects the
SSH user to be ec2-user, so you would have to specify this with
`--amazonec2-ssh-user ec2-user`.

View File

@@ -3,11 +3,9 @@ package virtualbox
import (
"archive/tar"
"bytes"
"errors"
"fmt"
"io"
"io/ioutil"
"math/rand"
"net"
"os"
"os/exec"
@@ -27,12 +25,7 @@ import (
)
const (
isoFilename = "boot2docker.iso"
defaultHostOnlyCIDR = "192.168.99.1/24"
)
var (
ErrUnableToGenerateRandomIP = errors.New("unable to generate random IP")
isoFilename = "boot2docker.iso"
)
type Driver struct {
@@ -51,7 +44,6 @@ type Driver struct {
SwarmDiscovery string
storePath string
Boot2DockerImportVM string
HostOnlyCIDR string
}
func init() {
@@ -94,12 +86,6 @@ func GetCreateFlags() []cli.Flag {
Usage: "The name of a Boot2Docker VM to import",
Value: "",
},
cli.StringFlag{
Name: "virtualbox-hostonly-cidr",
Usage: "Specify the Host Only CIDR",
Value: defaultHostOnlyCIDR,
EnvVar: "VIRTUALBOX_HOSTONLY_CIDR",
},
}
}
@@ -164,7 +150,6 @@ func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) error {
d.SwarmDiscovery = flags.String("swarm-discovery")
d.SSHUser = "docker"
d.Boot2DockerImportVM = flags.String("virtualbox-import-boot2docker-vm")
d.HostOnlyCIDR = flags.String("virtualbox-hostonly-cidr")
return nil
}
@@ -288,7 +273,20 @@ func (d *Driver) Create() error {
return err
}
if err := d.setupHostOnlyNetwork(d.MachineName); err != nil {
hostOnlyNetwork, err := getOrCreateHostOnlyNetwork(
net.ParseIP("192.168.99.1"),
net.IPv4Mask(255, 255, 255, 0),
net.ParseIP("192.168.99.2"),
net.ParseIP("192.168.99.100"),
net.ParseIP("192.168.99.254"))
if err != nil {
return err
}
if err := vbm("modifyvm", d.MachineName,
"--nic2", "hostonly",
"--nictype2", "82540EM",
"--hostonlyadapter2", hostOnlyNetwork.Name,
"--cableconnected2", "on"); err != nil {
return err
}
@@ -368,31 +366,12 @@ func (d *Driver) Create() error {
return nil
}
func (d *Driver) hostOnlyIpAvailable() bool {
ip, err := d.GetIP()
if err != nil {
log.Debug("ERROR getting IP: %s", err)
return false
}
if ip != "" {
log.Debugf("IP is %s", ip)
return true
}
log.Debug("Strangely, there was no error attempting to get the IP, but it was still empty.")
return false
}
func (d *Driver) Start() error {
s, err := d.GetState()
if err != nil {
return err
}
// check network to re-create if needed
if err := d.setupHostOnlyNetwork(d.MachineName); err != nil {
return err
}
switch s {
case state.Stopped, state.Saved:
d.SSHPort, err = setPortForwarding(d.MachineName, 1, "ssh", "tcp", 22, d.SSHPort)
@@ -412,18 +391,11 @@ func (d *Driver) Start() error {
log.Infof("VM not in restartable state")
}
// Wait for SSH over NAT to be available before returning to user
if err := drivers.WaitForSSH(d); err != nil {
return err
}
// Bail if we don't get an IP from DHCP after a given number of seconds.
if err := utils.WaitForSpecific(d.hostOnlyIpAvailable, 5, 4*time.Second); err != nil {
return err
}
d.IPAddress, err = d.GetIP()
return err
}
@@ -533,7 +505,6 @@ func (d *Driver) GetIP() (string, error) {
}
log.Debugf("SSH returned: %s\nEND SSH\n", output)
// parse to find: inet 192.168.59.103/24 brd 192.168.59.255 scope global eth1
lines := strings.Split(output, "\n")
for _, line := range lines {
@@ -601,56 +572,6 @@ func (d *Driver) generateDiskImage(size int) error {
return createDiskImage(d.diskPath(), size, raw)
}
func (d *Driver) setupHostOnlyNetwork(machineName string) error {
hostOnlyCIDR := d.HostOnlyCIDR
// This is to assist in migrating from version 0.2 to 0.3 format
// it should be removed in a later release
if hostOnlyCIDR == "" {
hostOnlyCIDR = defaultHostOnlyCIDR
}
ip, network, err := net.ParseCIDR(hostOnlyCIDR)
if err != nil {
return err
}
nAddr := network.IP.To4()
dhcpAddr, err := getRandomIPinSubnet(network.IP)
if err != nil {
return err
}
lowerDHCPIP := net.IPv4(nAddr[0], nAddr[1], nAddr[2], byte(100))
upperDHCPIP := net.IPv4(nAddr[0], nAddr[1], nAddr[2], byte(254))
log.Debugf("using %s for dhcp address", dhcpAddr)
hostOnlyNetwork, err := getOrCreateHostOnlyNetwork(
ip,
network.Mask,
dhcpAddr,
lowerDHCPIP,
upperDHCPIP,
)
if err != nil {
return err
}
if err := vbm("modifyvm", machineName,
"--nic2", "hostonly",
"--nictype2", "82540EM",
"--hostonlyadapter2", hostOnlyNetwork.Name,
"--cableconnected2", "on"); err != nil {
return err
}
return nil
}
// createDiskImage makes a disk image at dest with the given size in MB. If r is
// not nil, it will be read as a raw disk image to convert from.
func createDiskImage(dest string, size int, r io.Reader) error {
@@ -757,26 +678,3 @@ func setPortForwarding(machine string, interfaceNum int, mapName, protocol strin
}
return actualHostPort, nil
}
// getRandomIPinSubnet returns a pseudo-random net.IP in the same
// subnet as the IP passed
func getRandomIPinSubnet(baseIP net.IP) (net.IP, error) {
var dhcpAddr net.IP
nAddr := baseIP.To4()
// select pseudo-random DHCP addr; make sure not to clash with the host
// only try 5 times and bail if no random received
for i := 0; i < 5; i++ {
n := rand.Intn(25)
if byte(n) != nAddr[3] {
dhcpAddr = net.IPv4(nAddr[0], nAddr[1], nAddr[2], byte(1))
break
}
}
if dhcpAddr == nil {
return nil, ErrUnableToGenerateRandomIP
}
return dhcpAddr, nil
}

View File

@@ -1,31 +1 @@
package virtualbox
import (
"net"
"testing"
)
func TestGetRandomIPinSubnet(t *testing.T) {
// test IP 1.2.3.4
testIP := net.IPv4(byte(1), byte(2), byte(3), byte(4))
newIP, err := getRandomIPinSubnet(testIP)
if err != nil {
t.Fatal(err)
}
if testIP.Equal(newIP) {
t.Fatalf("expected different IP (source %s); received %s", testIP.String(), newIP.String())
}
if newIP[0] != testIP[0] {
t.Fatalf("expected first octet of %d; received %d", testIP[0], newIP[0])
}
if newIP[1] != testIP[1] {
t.Fatalf("expected second octet of %d; received %d", testIP[1], newIP[1])
}
if newIP[2] != testIP[2] {
t.Fatalf("expected third octet of %d; received %d", testIP[2], newIP[2])
}
}

View File

@@ -1,22 +0,0 @@
# Docker Machine Experimental Features
Docker Machines experimental features gives you access to bleeding edge features. By identifying experimental features, you can try out features early and give feedback to the Docker Machine maintainers. In this way, we hope to refine our feature designs by exposing them earlier to real-world usage.
This page describes the experimental features in Docker Machine. Docker Machine is currently in beta. Neither it nor its experimental features are ready for production use.
The information below describes each feature and the Github pull requests and
issues associated with it. If necessary, links are provided to additional
documentation on an issue. As an active Docker user and community member,
please feel free to provide any feedback on these features you wish.
## Current experimental features
Currently, you can experiment with [migrating a Boot2Docker created VM to Docker Machine](b2d_migration.md). Also, consider reviewing our [rough plan for the migration](b2d_migration_tasks.md).
Additional experimental features include support for Red Hat, Debian, CentOS, Fedora, and RancherOS as base OSes. These features have no separate feature documentation. We simply encourage you to try them.
## How to comment on an experimental feature
Each feature's documentation includes a list of proposal pull requests or PRs associated with the feature. If you want to comment on or suggest a change to a feature, please add it to the existing feature PR.
Issues or problems with a feature? Inquire for help on the `#docker-machine` IRC channel or in on the [Docker Google group](https://groups.google.com/forum/#!forum/docker-user).

View File

@@ -172,13 +172,8 @@ func (h *Host) CreateSSHShell() error {
return client.Shell()
}
func (h *Host) runActionForState(action func() error, desiredState state.State) error {
if drivers.MachineInState(h.Driver, desiredState)() {
log.Debug("Machine already in state %s, returning", desiredState)
return nil
}
if err := action(); err != nil {
func (h *Host) Start() error {
if err := h.Driver.Start(); err != nil {
return err
}
@@ -186,19 +181,31 @@ func (h *Host) runActionForState(action func() error, desiredState state.State)
return err
}
return utils.WaitFor(drivers.MachineInState(h.Driver, desiredState))
}
func (h *Host) Start() error {
return h.runActionForState(h.Driver.Start, state.Running)
return utils.WaitFor(drivers.MachineInState(h.Driver, state.Running))
}
func (h *Host) Stop() error {
return h.runActionForState(h.Driver.Stop, state.Stopped)
if err := h.Driver.Stop(); err != nil {
return err
}
if err := h.SaveConfig(); err != nil {
return err
}
return utils.WaitFor(drivers.MachineInState(h.Driver, state.Stopped))
}
func (h *Host) Kill() error {
return h.runActionForState(h.Driver.Kill, state.Stopped)
if err := h.Driver.Stop(); err != nil {
return err
}
if err := h.SaveConfig(); err != nil {
return err
}
return utils.WaitFor(drivers.MachineInState(h.Driver, state.Stopped))
}
func (h *Host) Restart() error {

View File

@@ -8,7 +8,7 @@ const (
// TODO: eventually the RPM install process will be integrated
// into the get.docker.com install script; for now
// we install via vendored RPMs
dockerCentosRPMPath = "https://test.docker.com/rpm/1.7.0-rc3/centos-7/RPMS/x86_64/docker-engine-1.7.0-0.3.rc3.el7.centos.x86_64.rpm"
dockerCentosRPMPath = "https://test.docker.com/rpm/1.7.0-rc1/centos-7/RPMS/x86_64/docker-engine-1.7.0-0.1.rc1.el7.centos.x86_64.rpm"
)
func init() {

View File

@@ -8,7 +8,7 @@ const (
// TODO: eventually the RPM install process will be integrated
// into the get.docker.com install script; for now
// we install via vendored RPMs
dockerFedoraRPMPath = "https://test.docker.com/rpm/1.7.0-rc3/fedora-21/RPMS/x86_64/docker-engine-1.7.0-0.3.rc3.fc21.x86_64.rpm"
dockerFedoraRPMPath = "https://test.docker.com/rpm/1.7.0-rc1/fedora-21/RPMS/x86_64/docker-engine-1.7.0-0.1.rc1.fc21.x86_64.rpm"
)
func init() {

View File

@@ -19,7 +19,7 @@ const (
// TODO: eventually the RPM install process will be integrated
// into the get.docker.com install script; for now
// we install via vendored RPMs
dockerRHELRPMPath = "https://test.docker.com/rpm/1.7.0-rc3/centos-7/RPMS/x86_64/docker-engine-1.7.0-0.3.rc3.el7.centos.x86_64.rpm"
dockerRHELRPMPath = "https://test.docker.com/rpm/1.7.0-rc1/centos-7/RPMS/x86_64/docker-engine-1.7.0-0.1.rc1.el7.centos.x86_64.rpm"
)
func init() {

View File

@@ -41,7 +41,7 @@ fi
# Script will bomb out on some dirs if there are no buildable source files,
# we shouldn't be checking these anyway so skip over them.
EXCLUDED_DIRS="${DIR}/Godeps ${DIR}/test ${DIR}/docs ${DIR}/script ${DIR}/experimental"
EXCLUDED_DIRS="${DIR}/Godeps ${DIR}/test ${DIR}/docs ${DIR}/script"
generate_coverage_for_dir ${DIR}
echo "Done checking and generating coverage!"

View File

@@ -55,7 +55,7 @@ func newCertificate(org string) (*x509.Certificate, error) {
NotBefore: notBefore,
NotAfter: notAfter,
KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature | x509.KeyUsageKeyAgreement,
KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,
BasicConstraintsValid: true,
}, nil
@@ -72,8 +72,6 @@ func GenerateCACertificate(certFile, keyFile, org string, bits int) error {
template.IsCA = true
template.KeyUsage |= x509.KeyUsageCertSign
template.KeyUsage |= x509.KeyUsageKeyEncipherment
template.KeyUsage |= x509.KeyUsageKeyAgreement
priv, err := rsa.GenerateKey(rand.Reader, bits)
if err != nil {

View File

@@ -2,7 +2,7 @@ package version
var (
// VERSION should be updated by hand at each release
VERSION = "0.3.0-rc3"
VERSION = "0.3.0-rc2"
// GITCOMMIT will be overwritten automatically by the build system
GITCOMMIT = "HEAD"