Created
November 2, 2022 22:34
-
-
Save dlbewley/ae1d678300db47cfcee8ec141385eb22 to your computer and use it in GitHub Desktop.
Podman login to all registries in pull secret
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
# if you don't want to just use --authfile or set REGISTRY_AUTH_FILE for whatever reason | |
# you may login to each registry in your pull secret thusly | |
# spoiler alert, here's how to extract usernames and passwords from your pull secret | |
PULL_SECRET_PATH=pull-secret.json | |
for R in $(jq -r '.auths|keys[]' $PULL_SECRET_PATH ); do | |
echo "Logging into $R" | |
U=$(jq -r ".auths.\"$R\".auth" $PULL_SECRET_PATH | base64 -d | awk -F: '{print $1}') | |
P=$(jq -r ".auths.\"$R\".auth" $PULL_SECRET_PATH | base64 -d | awk -F: '{print $2}') | |
podman login -u $U -p $P $R | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment