skip to Main Content

I am trying to deploy a nestjs application on a monorepo to GCD CI/CD "Cloud Build API". I pushed the images to Artifact Registry successfully.

My cloudbuild.yaml file looks like below:

steps:
  - name: 'gcr.io/cloud-builder/docker'
    args:
      [
        'build',
        '-t',
        'europe-west1-docker.pkg.dev/driven-atrium-414021/reservations/production',
        '-f',
        'apps/reservations/Dockerfile',
        '.',
      ]
  - name: 'gcr.io/cloud-builder/docker'
    args:
      [
        'push',
        'europe-west1-docker.pkg.dev/driven-atrium-414021/reservations/production',
      ]

  - name: 'gcr.io/cloud-builder/docker'
    args:
      [
        'build',
        '-t',
        'europe-west1-docker.pkg.dev/driven-atrium-414021/auth/production',
        '-f',
        'apps/auth/Dockerfile',
        '.',
      ]
  - name: 'gcr.io/cloud-builder/docker'
    args:
      [
        'push',
        'europe-west1-docker.pkg.dev/driven-atrium-414021/auth/production',
      ]

  - name: 'gcr.io/cloud-builder/docker'
    args:
      [
        'build',
        '-t',
        'europe-west1-docker.pkg.dev/driven-atrium-414021/notifications/production',
        '-f',
        'apps/notifications/Dockerfile',
        '.',
      ]
  - name: 'gcr.io/cloud-builder/docker'
    args:
      [
        'push',
        'europe-west1-docker.pkg.dev/driven-atrium-414021/notifications/production',
      ]

  - name: 'gcr.io/cloud-builder/docker'
    args:
      [
        'build',
        '-t',
        'europe-west1-docker.pkg.dev/driven-atrium-414021/payments/production',
        '-f',
        'apps/payments/Dockerfile',
        '.',
      ]
  - name: 'gcr.io/cloud-builder/docker'
    args:
      [
        'push',
        'europe-west1-docker.pkg.dev/driven-atrium-414021/payments/production',
      ]

I tried running $gcloud auth configure-docker gcr.io according to this source and I tried to play with permissions per other suggestions (new to GCP here) with no luck.

I got Caller does not have permission or the resource may not exist even though my user has the admin/owner role, I checked the repositories exists in the Artifact Repository. Here is a screenshot of my error from cloud build:
enter image description here

Any help on how to solve this problem?

2

Answers


  1. Chosen as BEST ANSWER

    It turns out, as @Marra commented, that the problem was mistyping the name of the cloud-builder/docker while it should be cloud-builders/docker (I missed the "s")

    I find it strange that GCP error message didn't differentiate between a missing resource and an inaccessible existing one!


  2. In your cloudbuild.yaml, change the names from gcr.io/cloud-builder/docker to gcr.io/cloud-builders/docker as stated in the documentation.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search