Korean original: Push Docker Image to GCR from WSL
Important: gcr.io is no longer available
Google Container Registry (gcr.io) has been shut down, and image writes have been blocked since March 18, 2025. Use Artifact Registry instead, or migrate your existing gcr.io addresses to it. The commands below use the Seoul region (asia-northeast3). Replace PROJECT_ID and REPO with your own values.
gcloud auth configure-docker asia-northeast3-docker.pkg.dev gcloud artifacts repositories create REPO --repository-format=docker --location=asia-northeast3 docker tag config-server asia-northeast3-docker.pkg.dev/PROJECT_ID/REPO/config-server:latest docker push asia-northeast3-docker.pkg.dev/PROJECT_ID/REPO/config-server:latest
What happened in the original 2020 log
The first push to the old gcr.io address failed with an error saying there was no active gcloud account, followed by an unauthorized error. The fix was to log in with gcloud auth login, set the project with gcloud config set project PROJECT_ID, and push again. The second push succeeded.
If the push fails: checklist
- Active account: run gcloud auth list. If no account is active, run gcloud auth login.
- Project: run gcloud config list and check the project value. If it is empty, run gcloud config set project PROJECT_ID.
- Docker credentials: run gcloud auth configure-docker with your registry host, for example asia-northeast3-docker.pkg.dev.
- Permissions: if you still get unauthorized or permission denied, check in IAM that your account has the Artifact Registry Writer role (roles/artifactregistry.writer).
- Repository exists: Artifact Registry needs the repository to be created before the first push, and the REPO name in the image tag must match it.
Verify the upload
List the images in the repository:
gcloud artifacts docker images list asia-northeast3-docker.pkg.dev/PROJECT_ID/REPO
Originally written in 2020 in Korean. This English version was added in November 2026.
댓글 없음:
댓글 쓰기