인증환경 구성
gcloud CLI 다운로드
- 다운로드 경로: https://cloud.google.com/sdk/docs#install_the_latest_cloud_tools_version_cloudsdk_current_version
설치
./google-cloud-sdk/install.sh
SDK 초기화
./google-cloud-sdk/bin/gcloud init
... <중략>
You are logged in as: [gcp로그인@이메일]
Pick cloud project to use:
[1] master-aegis-281915
[2] sftth319-elk-project
[3] Create a new project
Please enter numeric choice or text value (must exactly match list item): 3
Container Registry로 인증 설정
- 권장 설정: gcloud를 사용자 인증 정보 도우미로 사용 중 Docker 사용자 인증 정보 도우미로서의 gcloud
사용자 인증 정보로 인증 구성
gcloud auth login
다음 명령어로 Docker 구성
gcloud auth configure-docker
실행 내용
Adding credentials for all GCR repositories.
WARNING: A long list of credential helpers may cause delays running 'docker build'. We recommend passing the registry name to configure only the registry you are using.
After update, the following will be written to your Docker config file
located at [/Users/summit/.docker/config.json]:
{
"credHelpers": {
"gcr.io": "gcloud",
"us.gcr.io": "gcloud",
"eu.gcr.io": "gcloud",
"asia.gcr.io": "gcloud",
"staging-k8s.gcr.io": "gcloud",
"marketplace.gcr.io": "gcloud"
}
}
Docker Push
Docker Push Script
docker push gcr.io/mystic-airway-291209/sftth/whms:1.0.0
The push refers to repository [gcr.io/mystic-airway-291209/sftth/whms]
a49f5faea47c: Pushed
b619d345a89b: Pushed
24b310923aea: Pushed
6fcd3584d0ac: Pushed
0ec7fef6e7cc: Pushed
11008ef1d387: Pushed
a4b79db7b382: Pushed
3fd5bef4b2a5: Pushed
7a694df0ad6c: Layer already exists
3fd9df553184: Layer already exists
805802706667: Layer already exists
1.0.0: digest: sha256:7805bec21a18e771ce8eb1ab580896db0c9112af3108077938d0f74b68a22d9d size: 2610
GCR 업데이트 완료 화
Reference
https://cloud.google.com/container-registry/docs/advanced-authentication
댓글남기기