basic auth
This commit is contained in:
16
entrypoint.sh
Normal file
16
entrypoint.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
# If the credentials JSON is provided as an env var, materialise it as a
|
||||
# temporary file and point GOOGLE_APPLICATION_CREDENTIALS at it.
|
||||
# This avoids baking sensitive credentials into the image.
|
||||
#
|
||||
# Usage:
|
||||
# docker run -e GOOGLE_APPLICATION_CREDENTIALS_JSON="$(cat credentials.json)" ...
|
||||
if [ -n "$GOOGLE_APPLICATION_CREDENTIALS_JSON" ]; then
|
||||
CREDS_FILE="$(mktemp /tmp/gcloud-credentials-XXXXXX.json)"
|
||||
printf '%s' "$GOOGLE_APPLICATION_CREDENTIALS_JSON" > "$CREDS_FILE"
|
||||
export GOOGLE_APPLICATION_CREDENTIALS="$CREDS_FILE"
|
||||
fi
|
||||
|
||||
exec "$@"
|
||||
Reference in New Issue
Block a user