Improve documentation for google driver

Signed-off-by: David Gageot <david@gageot.net>
This commit is contained in:
David Gageot 2015-10-27 10:17:30 +01:00
parent c660130f17
commit e53b52de03
1 changed files with 29 additions and 8 deletions

View File

@ -10,19 +10,40 @@ parent="smn_machine_drivers"
# Google Compute Engine # Google Compute Engine
Create machines on [Google Compute Engine](https://cloud.google.com/compute/). You will need a Google account and project name. 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. See https://cloud.google.com/compute/docs/projects for details on projects.
The Google driver uses [Application Default Credentials](https://developers.google.com/identity/protocols/application-default-credentials). ### Credentials
So if `docker-machine` is started from a GCE host, authentication will happen automatically.
Otherwise, you have to run `gcloud auth login` once before using `docker-machine`.
Options: The Google driver uses [Application Default Credentials](https://developers.google.com/identity/protocols/application-default-credentials)
to get authorization credentials for use in calling Google APIs.
So if `docker-machine` is used from a GCE host, authentication will happen automatically
via the built-in service account.
Otherwise, [install gcloud](https://cloud.google.com/sdk/) and get
through the oauth2 process with `gcloud auth login`.
### Example
To create a machine instance, specify `--driver google`, the project and the machine name.
```
$ gcloud auth login
$ docker-machine create --driver google --google-project PROJECT_ID vm01
$ docker-machine create --driver google \
--google-project PROJECT_ID \
--google-zone us-central1-a \
--google-machine-type f1-micro \
vm02
```
### Options
- `--google-project`: **required** The name of your project to use when launching the instance.
- `--google-zone`: The zone to launch the instance. - `--google-zone`: The zone to launch the instance.
- `--google-machine-type`: The type of instance. - `--google-machine-type`: The type of instance.
- `--google-username`: The username to use for the instance. - `--google-username`: The username to use for the instance.
- `--google-project`: **required** The name of your project to use when launching the instance.
- `--google-scopes`: The scopes for OAuth 2.0 to Access Google APIs. See [Google Compute Engine Doc](https://cloud.google.com/storage/docs/authentication). - `--google-scopes`: The scopes for OAuth 2.0 to Access Google APIs. See [Google Compute Engine Doc](https://cloud.google.com/storage/docs/authentication).
- `--google-disk-size`: The disk size of instance. - `--google-disk-size`: The disk size of instance.
- `--google-disk-type`: The disk type of instance. - `--google-disk-type`: The disk type of instance.
@ -30,16 +51,16 @@ Options:
- `--google-preemptible`: Instance preemptibility. - `--google-preemptible`: Instance preemptibility.
- `--google-tags`: Instance tags (comma-separated). - `--google-tags`: Instance tags (comma-separated).
The GCE driver will use the `ubuntu-1404-trusty-v20150909a` instance type unless otherwise specified. The driver uses the `ubuntu-1404-trusty-v20150909a` disk image.
Environment variables and default values: Environment variables and default values:
| CLI option | Environment variable | Default | | CLI option | Environment variable | Default |
|---------------------------|-----------------------|--------------------------------------| |---------------------------|-----------------------|--------------------------------------|
| **`--google-project`** | `GOOGLE_PROJECT` | - |
| `--google-zone` | `GOOGLE_ZONE` | `us-central1-a` | | `--google-zone` | `GOOGLE_ZONE` | `us-central1-a` |
| `--google-machine-type` | `GOOGLE_MACHINE_TYPE` | `n1-standard-1` | | `--google-machine-type` | `GOOGLE_MACHINE_TYPE` | `n1-standard-1` |
| `--google-username` | `GOOGLE_USERNAME` | `docker-user` | | `--google-username` | `GOOGLE_USERNAME` | `docker-user` |
| **`--google-project`** | `GOOGLE_PROJECT` | - |
| `--google-scopes` | `GOOGLE_SCOPES` | `devstorage.read_only,logging.write` | | `--google-scopes` | `GOOGLE_SCOPES` | `devstorage.read_only,logging.write` |
| `--google-disk-size` | `GOOGLE_DISK_SIZE` | `10` | | `--google-disk-size` | `GOOGLE_DISK_SIZE` | `10` |
| `--google-disk-type` | `GOOGLE_DISK_TYPE` | `pd-standard` | | `--google-disk-type` | `GOOGLE_DISK_TYPE` | `pd-standard` |