Jib: seamless and automatic GCR (gcr.io) auth on GCP using Application Default Credentials (ADC): Google Cloud Build (GCB), Google Compute Engine (GCE), Google Kubernetes Engine (GKE), Cloud SDK application-default, service accounts, GOOGLE_APPLICATION_CREDENTIALS, etc #1903
Milestone
Creating an issue for easy lookup and search as well as for future reference.
On GCP, if no credentials were configured or could be retrieved for GCR access, Jib should try ADC that are available on most GCP environments as a last attempt. This will effectively resolve the case like #1500.
UPDATE: this feature is live and supported for Jib >= 1.5.0
ADC from Cloud SDK
Jib can get ADC set through
gcloud auth application-default login
. ADC in this case are "end user credentials". (Note thatgcloud auth login
won't work, as it isn't ADC.)ADC from Service Account
The current implementation for a service account is to generate a short-lived OAuth2 access token from the service account and use it for GCR auth.
ADC on Google Cloud Build (GCB)
ADC are available on GCB and have the permission to push to GCR.
ADC on Google Compute Engine (GCE)
Tested on Linux and Windows:
ADC on Cloud Shell
Confirmed it works. However, Cloud Shell has
docker-credential-gcloud
,docker-credential-gcr
, and~/.docker/config.json
, so it's already working pretty well without this ADC support.ADC on Cloud Run
To be tested.
The text was updated successfully, but these errors were encountered: