<p>I'm using the &quot;Workloads&quot; service of Kubernetes Engine of Google Cloud Platform to deploy my application.</p>
<p>Once you click on deploy I can see in &quot;Cloud Build&quot; what command GCP has launched:
<a href="https://i.stack.imgur.com/qpHuO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qpHuO.png" alt="enter image description here" /></a></p>
<p>The current build command is: <code>build -t gcr.io/ma...g:9e4dab3 -d Dockerfile</code></p>
<p>Is there a way to change the build command ? Like: <code>build -t gcr.io/ma...g:9e4dab3 -d Dockerfile --build-arg APP_ENV=dev</code></p>

Lenny4
<p>Workloads is a <strong>beta</strong> feature, and doesn't include any option to add or modify the build command you can open a <a href="https://cloud.google.com/support/docs/issue-trackers" rel="nofollow noreferrer">feature request</a> for this functionality.</p>
<p>As a workaround you can create your image directly and storing it on Container Registry by using Cloud build with all parameters necessaries for your image.</p>
<p>Additionally you can create a build to automate this process, For example:</p>
<pre><code>steps:

#Building Red Velvet Image
- name: 'gcr.io/cloud-builders/docker'
  id: build-redvelvet
  args:
  - build
  - --tag=${_RV}:$SHORT_SHA
  - --tag=${_RV}:latest
  - --build-arg APP_ENV=dev
  - .
  dir: 'redvelvet/'

#Pushing Red Velvet Image
- name: 'gcr.io/cloud-builders/docker'
  id: push-redvelvet
  args:
  - push
  - ${_RV}

#Deploying to GKE
- name: &quot;gcr.io/cloud-builders/gke-deploy&quot;
  id: deploy-gke
  args:
  - run
  - --filename=something.yaml
  - --location=${_COMPUTE_ZONE}
  - --cluster=${_CLUSTER_NAME}

#Update Red Velvet Image
- name: 'gcr.io/cloud-builders/kubectl'
  id: update-redvelvet
  args:
  - set
  - image
  - deployment/redvelvet-deployment
  - redvelvet=${_RV}:$SHORT_SHA
  env:
  - 'CLOUDSDK_COMPUTE_ZONE=${_COMPUTE_ZONE}'
  - 'CLOUDSDK_CONTAINER_CLUSTER=${_CLUSTER_NAME}'
  waitFor:
    - deploy-gke

substitutions:
    _RV: gcr.io/${PROJECT_ID}/redvelvet
    _CLUSTER_NAME: something
    _COMPUTE_ZONE: us-central1
</code></pre>
