Wells
Wells

Reputation: 10969

Deploying Cloud Run job works fine, using cloudbuild.yml fails in cryptic manner

This works fine:

gcloud run jobs deploy myjob --project myproject --image us-east1-docker.pkg.dev/myproject/myrepo/myimage:latest --region us-east1 

It yields:

✓ Creating job... Done.                                                                                                                                                                                                             
Done.                                                                                                                                                                                                                               
Job [my job] has successfully been deployed.

This segment in cloudbuild.yml does not work:

steps:
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
  id: Deploy
  args: ['run',
    'jobs',
    'deploy',
    'myjob',
    '--project',
    '$PROJECT_ID',
    '--image',
    '$LOCATION-docker.pkg.dev/$PROJECT_ID/myrepo/myimage:latest',
    '--region',
    '$LOCATION']

Fails at the end with this:

ERROR: build step 0 "gcr.io/google.com/cloudsdktool/cloud-sdk" failed: starting step container failed: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: exec: "run": executable file not found in $PATH: unknown
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

BUILD FAILURE: Build step failure: build step 0 "gcr.io/google.com/cloudsdktool/cloud-sdk" failed: starting step container failed: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: exec: "run": executable file not found in $PATH: unknown
ERROR: (gcloud.builds.submit) build 48bc04d3-33c6-4173-8c43-8d5189ef001f completed with status "FAILURE"

I run this by executing:

gcloud builds submit --project=glacier-444222 --region=us-east1 --config cloudbuild.yml

I have no idea what the difference is here.

Upvotes: 0

Views: 43

Answers (1)

Wells
Wells

Reputation: 10969

Looks like changing the name of the Docker image to gcr.io/cloud-builders/gcloud does the trick. Don't really understand the various versions here, would be grateful for any clarity.

Upvotes: 0

Related Questions