GoogleCloudPlatform/docker-registry — pull request #16 by proppy (2014-08-28 22:33:33+00:00)
Title: run.sh: add support for GCP_ACCOUNT

Fixes #7

/cc @jbeda @ktintc @dlorenc

### Tests
#### Without GCP_ACCOUNT
```
$ docker run -e GCS_BUCKET=proppy-containers --volumes-from gcloud-config proppy/docker-registry bash -c "cd /docker-registry && ./setup-configs.sh && exec bash ./run.sh"
Using credentials in /.config/gcloud/legacy_credentials/proppy@google.com/.boto
```
#### With GCP_ACCOUNT
```
$ docker run -e GCS_BUCKET=proppy-containers -e GCP_ACCOUNT=proppy@google.com --volumes-from gcloud-config proppy/docker-registry bash -c "cd /docker-registry && ./setup-configs.sh && exec bash ./run.sh"
Using credentials in /.config/gcloud/legacy_credentials/proppy@google.com/.boto
```
#### Error
```
$ docker run -e GCS_BUCKET=proppy-containers -e GCP_ACCOUNT=foo --volumes-from gcloud-config proppy/docker-registry bash -c "cd /docker-registry && ./setup-configs.sh && exec bash ./run.sh"
find: `/.config/gcloud/legacy_credentials/foo/.boto': No such file or directory
Boto credentials not found. Either:
- Set GCP_OAUTH2_REFRESH_TOKEN
- Set BOTO_PATH
- Mount gcloud credentials under /.config in the container and optionally set GCP_ACCOUNT
- Run in GCE with a service account configured for devstorage access

docker run -e GCS_BUCKET=yet-another-docker-bucket [-e GCP_ACCOUNT='' ] [-e BOTO_PATH='/.config/gcloud/legacy_credentials//.boto'] [-e GCP_OAUTH2_REFRESH_TOKEN=] -p 5000:5000 [--volumes-from gcloud-config] google/docker-registry
```