Skip to content

turbinelabs/gcloud-build

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GCloud SDK Build Image

This project is no longer maintained by Turbine Labs, which has shut down.

Apache 2.0

This is an image intended to be used as a build base image in a CI environment. It's based on the official CloudSDK alpine image, however it also includes docker and kubectl so you can build and deploy docker images. It will also automatically configure gcloud to access a specific GKE cluster based on environment variables.

Requirements

To build this project you will need Docker. To deploy a project to GCloud you'll need a GCloud Account account.

Running

This image uses environment variables to configure GCloud authentication, project ids, compute zones and cluster names. Observed environment variables are

  • GOOGLE_AUTH: a base64 encoded service account key
  • GCLOUD_PROJECT_ID: the ID (not name!) of the project you wish to work with
  • GCLOUD_COMPUTE_ZONE: the compute zone your cluster is located in
  • GCLOUD_CLUSTER_NAME: the name of the cluster you wish to work with

Given the length of the GOOGLE_AUTH variable we suggest you keep these values in a file, e.g.

GOOGLE_AUTH=<your base64 encoded service account key>
GCLOUD_PROJECT_ID=<your project ID>
GCLOUD_COMPUTE_ZONE=<your compute zone>
GCLOUD_CLUSTER_NAME=<your cluster name>

CloudSDK configuration is performed when the run level is changed to "boot". To use the container to execute builds you can run

docker run --env-file <your settings> -it turbinelabs/gcloud-build:0.19.0 /bin/bash

open rc boot

Building

If you want to build your own image you can run the following:

docker build -t turbinelabs/gcloud-build:local .

By default this will build an Alpine Linux 3.5 image with GCloud SDK version 168.0.0 and docker. You can override the GCloud SDK version by setting the CLOUD_SDK_VERSION environment variable. You can then use your locally built image by running:

docker run --env-file <your settings> -it turbinelabs/gcloud-build:latest /bin/bash

open rc boot

Versioning

Please see Versioning of Turbine Labs Open Source Projects.

Pull Requests

Patches accepted! Please see Contributing to Turbine Labs Open Source Projects.

Code of Conduct

All Turbine Labs open-sourced projects are released with a Contributor Code of Conduct. By participating in our projects you agree to abide by its terms, which will be carefully enforced.