summary of the commands and steps I executed - until I have successfully pulled Docker images from Google Artifact Registry (GAR):
Final Outcome
You successfully pulled:
asia-southeast1-docker.pkg.dev/escian/todoapp/hello-app:1.0
asia-southeast1-docker.pkg.dev/escian/booranasak-artifact-registry-docker/fastapi-app:v1
📜 Step-by-Step Command Summary
🔸 1. Initial Setup Attempts
- Tried interactive login (but canceled):
gcloud auth login
gcloud init
🔸 2. Created and Prepared Service Account
- Saved service account credentials to
escian-bb074f590610.json
- Confirmed it’s the correct service account for GAR access:
"client_email": "escian-devops-artifact@escian.iam.gserviceaccount.com"
🔸 3. Activated the Service Account
gcloud auth activate-service-account --key-file=escian-bb074f590610.json
✅ This set the service account as the active credential.
🔸 4. Set GCP Project (Partial Success)
gcloud config set project escian
⚠️ Warned that Cloud Resource Manager API was disabled (can ignore for image pull).
🔸 5. Configured Docker to Authenticate with GAR
gcloud auth configure-docker asia-southeast1-docker.pkg.dev --quiet
✅ This added the necessary section to
~/.docker/config.json
:
{
"credHelpers": {
"asia-southeast1-docker.pkg.dev": "gcloud"
}
}
🔸 6. Verified Docker Credential Helper
docker-credential-gcloud list
🟡 Note:
asia-southeast1-docker.pkg.dev
is NOT shown here – but that's expected becausedocker-credential-gcloud
doesn’t show Artifact Registry entries.
🔸 7. First Pull Attempts (Failed)
You ran:
docker pull asia-southeast1-docker.pkg.dev/escian/booranasak-artifact-registry-docker/fastapi-app:v1
❌ Failed with:
Unauthenticated request
— this was before proper configuration.
🔸 8. Final Successful Pulls
Once everything was configured:
docker pull asia-southeast1-docker.pkg.dev/escian/todoapp/hello-app:1.0
docker pull asia-southeast1-docker.pkg.dev/escian/booranasak-artifact-registry-docker/fastapi-app:v1
✅ Both images pulled successfully!
🧠 Lessons Learned / Tips
-
gcloud auth configure-docker
+gcloud auth activate-service-account
is enough if the service account has permission. -
No need for
docker login
manually if Docker reads from~/.docker/config.json
viacredHelpers
. -
docker-credential-gcloud list
doesn’t reflect Artifact Registry — don't rely on it for GAR validation. - If all fails, use:
gcloud auth print-access-token | docker login -u oauth2accesstoken --password-stdin https://asia-southeast1-docker.pkg.dev
Top comments (0)