Last active
October 6, 2022 08:41
-
-
Save antdking/46d33b3e09cac3cc34bbbe3ce3eb33f4 to your computer and use it in GitHub Desktop.
Setup pkg.dev authentication
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# gcloud doesn't provide a mechanism to configure Artifact Registry auth helpers out the box. | |
# ref: https://cloud.google.com/artifact-registry/docs/docker/authentication?hl=en-GB#gcloud-helper | |
registries="$(gcloud artifacts locations list --format json | jq -r '. | map("\(.name)-docker.pkg.dev") | join(",") | @sh')" | |
# don't quote 'registries', it's already escaped by jq | |
gcloud auth configure-docker $registries |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment