0

I'm trying to setup a CD from cloud build with below cloud build yaml file,

steps:
  - name: gcr.io/cloud-builders/gcloud
    args: [ 'compute', 'ssh', '<my-ce-name>', '--zone', 'us-west2-a', '--command', 'docker rm -f container-name && docker pull gcr.io/$PROJECT_ID/my-image-name:latest && docker run  -d -p 80:8080 --name container-name gcr.io/$PROJECT_ID/my-image-name:latest' ]

The build runs but fails with the below error,

Permission denied (publickey).

I assume there is some problem in the way the ssh is being handled. What's the way out?

Kannan Ramamoorthy
  • 3,980
  • 9
  • 45
  • 63
  • You can check this StackOverflow threads [1](https://stackoverflow.com/questions/72626843/unable-to-connect-cloudbuild-to-compute-engine) and [2](https://stackoverflow.com/questions/72859970/how-to-ssh-scp-from-cloud-build-thru-iap-tunnel) – Siegfred V. Dec 23 '22 at 00:27

0 Answers0