Source: GCP DevOps tricks: Create a custom Cloud Shell image that includes Terraform and Helm from Google Cloud
If you develop or manage apps on Google Cloud Platform(GCP), you’re probably familiar with Cloud Shell, which provides you with a secure CLI that you can use to manage your environment directly from the browser. But while Cloud Shell’s default image contains most of the tools you could wish for, in some cases you might need more—for example, Terraform for infrastructure provisioning, or Helm, the Kubernetes package manager.
In this blog post, you will learn how to create a custom Docker image for Cloud Shell that includes the Helm client and Terraform. At a high level, this is a two-step process:
Let’s take a closer look.
First, you need to create new Docker image that’s based on the default Cloud Shell image and then publish the image you created to Container Registry.
1. Create a new repo and set the project ID where the Docker image should be published:
2. With your file editor of choice, create a file named
Dockerfile with the following content:
3. Build the Docker image:
4. Push the Docker image to Container Registry:
Note: You will need to configure Docker to authenticate with gcr by following the steps here.
Now that you’ve created and published your image, you need to configure the Cloud Shell Environment to utilize the image that was published to Container Registry. In the Cloud Console follow these steps:
There you have it—a way to configure your Cloud Shell environment with all your favorite tools. To learn more about Cloud Shell, check out the documentation.