Patrick
Patrick

Reputation: 2709

installing Google Cloud SDK on Compute Engine: permission denied error

I started an instance on Google Compute Engine based on cos-stable image (for Docker). Now I try to install cloud SDK on my VM (unfortunately I did not find any image with Docker AND gcloud). Following instructions from Google doc (https://cloud.google.com/sdk/docs/quickstart) I did:

wget https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-313.0.1-linux-x86_64.tar.gz
tar xvf google-cloud-sdk-313.0.1-linux-x86_64.tar.gz
./google-cloud-sdk/bin/gcloud init

but got the error -bash: ./google-cloud-sdk/bin/gcloud: Permission denied. Same result with sudo. What did I do wrong?

Upvotes: 1

Views: 952

Answers (1)

guillaume blaquiere
guillaume blaquiere

Reputation: 75705

The COS is minimal to run docker and.... that's all!! I won't be surprised is many stuff are forbidden to keep the VM attack surface the smallest possible.

I recommend you to use this command instead:

docker run -it google/cloud-sdk:slim

With a gcloud auth list you can see that the Compute Engine service account is detected and you can use it to perform your actions.

Enter exit or perform Ctrl+D to exit the container in interactive mode

Upvotes: 4

Related Questions