diff --git a/site/static/examples/kind-gcr.sh b/site/static/examples/kind-gcr.sh index 19eca93f1a..cd695d9b13 100755 --- a/site/static/examples/kind-gcr.sh +++ b/site/static/examples/kind-gcr.sh @@ -10,6 +10,16 @@ DOCKER_CONFIG=$(mktemp -d) export DOCKER_CONFIG trap 'echo "Removing ${DOCKER_CONFIG}/*" && rm -rf ${DOCKER_CONFIG:?}' EXIT +echo "Creating a temporary config.json" +# This is to force the omission of credsStore, which is automatically +# created on supported system. With credsStore missing, "docker login" +# will store the password in the config.json file. +# https://docs.docker.com/engine/reference/commandline/login/#credentials-store +cat <"${DOCKER_CONFIG}/config.json" +{ + "auths": { "gcr.io": {} } +} +EOF # login to gcr in DOCKER_CONFIG using an access token # https://cloud.google.com/container-registry/docs/advanced-authentication#access_token echo "Logging in to GCR in temporary docker client config directory ..." @@ -27,4 +37,4 @@ for node in $(kind get nodes --name "${KIND_CLUSTER_NAME}"); do docker exec "${node_name}" systemctl restart kubelet.service done -echo "Done!" \ No newline at end of file +echo "Done!"