diff --git a/docs/drivers/gce.md b/docs/drivers/gce.md index a23ba91be3..28050ca591 100644 --- a/docs/drivers/gce.md +++ b/docs/drivers/gce.md @@ -53,7 +53,7 @@ $ docker-machine create --driver google \ - `--google-tags`: Instance tags (comma-separated). - `--google-use-internal-ip`: When this option is used during create it will make docker-machine use internal rather than public NATed IPs. The flag is persistent in the sense that a machine created with it retains the IP. It's useful for managing docker machines from another machine on the same network e.g. while deploying swarm. -The GCE driver will use the `ubuntu-1404-trusty-v20150909a` instance image unless otherwise specified. To obtain a +The GCE driver will use the `ubuntu-1404-trusty-v20151113` instance image unless otherwise specified. To obtain a list of image URLs run: ``` gcloud compute images list --uri @@ -66,7 +66,7 @@ Environment variables and default values: | **`--google-project`** | `GOOGLE_PROJECT` | - | | `--google-zone` | `GOOGLE_ZONE` | `us-central1-a` | | `--google-machine-type` | `GOOGLE_MACHINE_TYPE` | `f1-standard-1` | -| `--google-machine-image` | `GOOGLE_MACHINE_IMAGE` | `ubuntu-1404-trusty-v20150909a` | +| `--google-machine-image` | `GOOGLE_MACHINE_IMAGE` | `ubuntu-1404-trusty-v20151113` | | `--google-username` | `GOOGLE_USERNAME` | `docker-user` | | `--google-scopes` | `GOOGLE_SCOPES` | `devstorage.read_only,logging.write` | | `--google-disk-size` | `GOOGLE_DISK_SIZE` | `10` | diff --git a/drivers/google/google.go b/drivers/google/google.go index c82527b263..9daada4846 100644 --- a/drivers/google/google.go +++ b/drivers/google/google.go @@ -32,7 +32,7 @@ const ( defaultZone = "us-central1-a" defaultUser = "docker-user" defaultMachineType = "n1-standard-1" - defaultImageName = "https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/images/ubuntu-1404-trusty-v20150909a" + defaultImageName = "https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/images/ubuntu-1404-trusty-v20151113" defaultScopes = "https://www.googleapis.com/auth/devstorage.read_only,https://www.googleapis.com/auth/logging.write" defaultDiskType = "pd-standard" defaultDiskSize = 10 @@ -181,7 +181,7 @@ func (d *Driver) PreCreateCheck() error { return err } - // Check that the project exists. It will also check that credentials + // Check that the project exists. It will also check the credentials // at the same time. log.Infof("Check that the project exists") @@ -229,10 +229,19 @@ func (d *Driver) GetURL() (string, error) { // GetIP returns the IP address of the GCE instance. func (d *Driver) GetIP() (string, error) { + machineState, err := d.GetState() + if err != nil { + return "", err + } + if machineState != state.Running { + return "", drivers.ErrHostIsNotRunning + } + c, err := newComputeUtil(d) if err != nil { return "", err } + return c.ip() }