Auto-trigger docker build for gcloud (google cloud command line) when new release is announced
100K+
gcloud images is quite large, used a lot of free credit. So I have to stop the build now. No new tag will be published any more (from 15/07/2021)Auto-trigger docker build for gcloud when new release is announced
All gcloud components are installed, the size of image is quite large (>2.8GB).
The latest docker tag is the latest release version mentioned in https://cloud.google.com/sdk/docs/release-notes
Please avoid to use latest tag for any production deployment. Tag with right version is the proper way, such as alpine/gcloud:290.0.1
https://github.com/alpine-docker/gcloud
https://travis-ci.org/alpine-docker/gcloud
https://hub.docker.com/r/alpine/gcloud/tags/
Since this container mostly is not running in Google Cloud Shell, so I would recommand to generate credential file and feed to it.
$ mkdir -p ~/.config/gcloud
$ docker run -ti --rm -v ~/.alpine/gcloud:290.0.1 gcloud auth application-default login
$ cat ~/.config/gcloud/application_default_credentials.json
{
"client_id": "764086051850-6qr4p6gpi6hn506pt8ejuq83di341hur.apps.googleusercontent.com",
"client_secret": "d-FL95Q19q7MQmFpd7hHD0Tx",
"refresh_token": "1//0gnhgE8nu6YhICgYIARAAGBASNwF-L9IrERjKiLhTFNx_J2kVsvuC6vg0IbF5tl5g7z4NksVp0WEFBvj9KBlMCNmp9iRdImTljoc",
"type": "authorized_user"
}
You need run above command one time for each project, the credentials are saved to local host: ~/.config/gcloud/application_default_credentials.json
Now you are fine to feed it to gcloud container.
$ docker run -ti --rm -v ~/.config:/root/.config -e GOOGLE_APPLICATION_CREDENTIALS="~/.config/gcloud/application_default_credentials.json" alpine/gcloud:290.0.1 gcloud config list
make above command as alias, so you needn't type them again.
$ alias gcloud="docker run -ti --rm -v ~/.config:/root/.config -e GOOGLE_APPLICATION_CREDENTIALS="~/.config/gcloud/application_default_credentials.json" alpine/gcloud:290.0.1 gcloud"
$ gcloud config list
[accessibility]
screen_reader = true
[compute]
region = us-central1
zone = us-central1-a
[core]
account = [email protected]
disable_usage_reporting = True
project = qwiklabs-gcp-01-6b02c2d236db
Your active configuration is: [default]
Mostly it is used during CI/CD (continuous integration and continuous delivery) or as part of an automated build/deployment
Content type
Image
Digest
Size
1.3 GB
Last updated
almost 6 years ago
docker pull alpine/gcloud:310.0.0Pulls:
155
Last week