[업데이트 2026-10]
Container Registry(gcr.io)는 종료되어 2025년 3월 18일부터 이미지 쓰기가 막혔다. 아래 gcr.io 푸시 방식은 그대로는 쓸 수 없고, Artifact Registry를 쓰거나 gcr.io 주소를 Artifact Registry로 마이그레이션해야 한다. 서울 리전 기준으로는 이렇게 한다.
$ 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
이메일, 프로젝트 ID, 로그인 URL, PC 이름은 노출을 피하려고 가렸다. 아래는 2020년 당시 기록이다.
user@pc:~$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
asia.gcr.io/PROJECT_ID/config-server latest f9559cb4a95e 25 hours ago 135MB
test/configserver latest f9559cb4a95e 25 hours ago 135MB
openjdk 8-jdk-alpine a3562aa0b991 10 months ago 105MB
hello-world latest fce289e99eb9 15 months ago 1.84kB
user@pc:~$ docker push asia.gcr.io/PROJECT_ID/config-server
WARNING: Could not open the configuration file: [/home/user/.config/gcloud/configurations/config_default].
ERROR: (gcloud.auth.docker-helper) You do not currently have an active account selected.
Please run:
$ gcloud auth login
to obtain new credentials, or if you have already logged in with a
different account:
$ gcloud config set account ACCOUNT
to select an already authenticated account to use.
The push refers to repository [asia.gcr.io/PROJECT_ID/config-server]
9bb9d4296990: Preparing
ceaf9e1ebef5: Preparing
9b9b7f3d56a0: Preparing
f1b5933fe4b5: Preparing
unauthorized: You don't have the needed permissions to perform this operation, and you may have invalid credentials. To authenticate your request, follow the steps in: https://cloud.google.com/container-registry/docs/advanced-authentication
user@pc:~$ gcloud auth login
Go to the following link in your browser:
(로그인 URL 생략)
Enter verification code: <Hidden>
You are now logged in as [계정 이메일].
Your current project is [None]. You can change this setting by running:
$ gcloud config set project PROJECT_ID
user@pc:~$ gcloud config set project PROJECT_ID
Updated property [core/project].
user@pc:~$ docker push asia.gcr.io/PROJECT_ID/config-server
The push refers to repository [asia.gcr.io/PROJECT_ID/config-server]
9bb9d4296990: Pushed
ceaf9e1ebef5: Layer already exists
9b9b7f3d56a0: Layer already exists
f1b5933fe4b5: Layer already exists
latest: digest: sha256:5b309a37ba393e74461b10eb52c96b4dc670425b1ba546ffa27f618e607ef6d5 size: 1159