GoogleCloudPlatform / GoogleCloudPlatform/cloud-builders-community

Gcloud commands cannot be run from your Make image

Open
#477 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
1.3k
Forks
848
PR merge metrics
No merged PRs in 30d

Description

## `gcr.io/cloud-builders-community/make`

## Expected Behavior

To be able to use a Makefile that contains gcloud commands (such as the gcloud KMS API) when using this image in our pipeline instead of the Google Cloud provided `gcr.io/cloud-builders/gcloud`.

## Actual Behavior

We set up our pipeline to pull and use the provided `gcr.io/cloud-builders-community/make` image. When we run our pipeline which contains the following Make task:

```
gcloud kms decrypt --location=$(REGION) ... # some more secret flags, shhh!
```

We find that the gcloud command is not installed on this image.

## Steps to Reproduce the Problem

(With the Make image set up correctly in your GCP project)

1. Add a Makefile to your application that contains a task that runs a gcloud command, e.g.:

_In your Makefile_
```
gcloud_help:
gcloud help
```
2. Add a pipeline step to your cloudbuild.yaml that runs this Make command:

_In cloudbuild.yaml_
```
steps:
- id: "cloud help"
name: gcr.io/$PROJECT_ID/make
args:
- gcloud_help
```

3. push and run your pipeline. It should fail with a message similar to the following:

_In CloudBuild console_
```
Step #0 - "cloud help": make[1]: gcloud: Command not found
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.