Skip to content

Instantly share code, notes, and snippets.

@btipling
Forked from srounce/docker-secret.sh
Created December 19, 2016 05:19
Show Gist options
  • Save btipling/8c87c0d43398c9a55557fde479c0c85b to your computer and use it in GitHub Desktop.
Save btipling/8c87c0d43398c9a55557fde479c0c85b to your computer and use it in GitHub Desktop.
#!/usr/bin/env sh
SPATH="$(cd $(dirname "$0") && pwd -P)"
SECRET_NAME=${1:-docker-registry-secret}
CONFIG_PATH=${2:-$SPATH/localkube.json}
if [[ ! -f $CONFIG_PATH ]]; then
echo "Unable to locate service account config JSON: $CONFIG_PATH";
exit 1;
fi
kubectl create secret docker-registry $SECRET_NAME \
--docker-server "https://gcr.io" \
--docker-username _json_key \
--docker-email not@val.id \
--docker-password="`cat $CONFIG_PATH`" ${@:3}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment