3
votes

As described here, it's possible to submit a Dockerfile build using gcloud builds submit -t <source>. However, is it possible to pass additional build args to it? I tried gcloud builds sumbit -t <source> --build-arg=FOO=$BAR but it didn't recognize the flags. The old gcloud docker command use to support pass-through of docker args. I don't want to use a cloudbuild.yaml file if I can avoid it since I'm relying on Azure DevOps for the build and don't want to clutter up my repo with more YAML pipeline files.

My use case is that I want to leverage google cloud build's layer caching for faster builds since Azure DevOps doesn't have that built-in.

1

1 Answers

4
votes

You can't pass some argument to Cloud Build with the -t argument docker build. Only cloudbuild.yaml config file accepts variables