I'm trying to use Docker registry V2 API with Google Container Registry, specifically this endpoint:
curl -I \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
https://gcr.io/v2/$PROJECT/hello/blobs/$digest
But I'd like to do it with code and not via CLI and not using gcloud
.
I have a service account and a json key file. Is it possible?
This is a related question Get service account auth token without gcloud? But the link attached in the chosen answer doesn't help with this need.