Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dockercfg-generator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ RUN apk add --no-cache \
bash \
ca-certificates \
openssl \
docker \
&& wget "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${GOOGLE_CLOUD_VERSION}-linux-x86_64.tar.gz" \
&& gunzip "google-cloud-sdk-${GOOGLE_CLOUD_VERSION}-linux-x86_64.tar.gz" \
&& tar xf "google-cloud-sdk-${GOOGLE_CLOUD_VERSION}-linux-x86_64.tar" \
Expand Down
13 changes: 10 additions & 3 deletions dockercfg-generator/gcr_docker_creds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,15 @@ echo "${GOOGLE_AUTH_JSON}" > /keyconfig.json
gcloud auth activate-service-account "${GOOGLE_AUTH_EMAIL}" --key-file /keyconfig.json --project "${GOOGLE_PROJECT_ID}"

# Syncing credentials
echo "Syncing GCR credentials"
gcloud docker -a
echo "Syncing GCR credentials for gcr.io"
gcloud auth print-access-token | docker login -u oauth2accesstoken --password-stdin https://gcr.io
echo "Syncing GCR credentials for us.gcr.io"
gcloud auth print-access-token | docker login -u oauth2accesstoken --password-stdin https://us.gcr.io
echo "Syncing GCR credentials for eu.gcr.io"
gcloud auth print-access-token | docker login -u oauth2accesstoken --password-stdin https://eu.gcr.io
echo "Syncing GCR credentials for asia.gcr.io"
gcloud auth print-access-token | docker login -u oauth2accesstoken --password-stdin https://asia.gcr.io

echo "Writing Docker creds to $1"
cat ~/.dockercfg > $1
chmod 544 ~/.docker/config.json
cp ~/.docker/config.json $1