Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

381
Views
Google Cloud Build Docker build-arg not respected

I'm having a problem with Google Cloud Build where the docker build command doesn't seem to be accepting the build-arg option, even though this same command works as expected on local:

Dockerfile:

ARG ASSETS_ENV=development
RUN echo "ASSETS_ENV is ${ASSETS_ENV}"

Build Command:

docker build --build-arg="ASSETS_ENV=production" .

Result on local:

ASSETS_ENV is production

Result on Cloud Build:

ASSETS_ENV is development
over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Ok the fix was in the cloud build yaml config:

Before:

- name: 'gcr.io/cloud-builders/docker'
  args: ['build', '--build-arg="ASSETS_ENV=production"', '.']

After:

- name: 'gcr.io/cloud-builders/docker'
  entrypoint: 'bash'
  args: ['-c', 'docker build --build-arg="ASSETS_ENV=production" .']
over 4 years ago · Santiago Trujillo Report

0

For anyone who defines their steps like this:

- name: 'gcr.io/cloud-builders/docker'
  args:
  - build
  - foo
  - bar

The comment from @nader-ghanbari worked for me:

- name: 'gcr.io/cloud-builders/docker'
  args:
  - build
  - --build-arg
  - TF2_BASE_IMAGE=${_TF2_BASE_IMAGE}
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!