I am trying to create a docker swarm node on a VM instance on GCP using docker-machine
.
docker-machine create swarm-node -d google --google-machine-type e2-standard-2 --google-zone europe-north1-a --google-project myproject-name
I use a GCP Service Account in localhost docker-machine CLI.
export GOOGLE_APPLICATION_CREDENTIALS="/home/my-name-here/.gcp/path-to-my-service-account-keyfile.json"
But I got this error:
Error with pre-create check: "Project with ID \"myproject-name\" not found. googleapi: Error 403: Required 'compute.projects.get' permission for 'projects/myproject-name', forbidden"
How can I add compute.projects.get
GCP IAM access to the GCP Service Account?
Finally I figured out, as explained at: https://cloud.google.com/iam/docs/granting-changing-revoking-access
Compute Admin
Et voilà
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.