Fixes #988 run_in_docker.sh only works with gcr.io
This commit is contained in:
parent
6e80e627ac
commit
509afaf112
|
|
@ -30,15 +30,21 @@ if [[ ! -z "$4" ]]; then
|
|||
cache=$4
|
||||
fi
|
||||
|
||||
if [[ ! -e $HOME/.config/gcloud/application_default_credentials.json ]]; then
|
||||
echo "Application Default Credentials do not exist. Run [gcloud auth application-default login] to configure them"
|
||||
exit 1
|
||||
if [[ $destination == *"gcr"* ]]; then
|
||||
if [[ ! -e $HOME/.config/gcloud/application_default_credentials.json ]]; then
|
||||
echo "Application Default Credentials do not exist. Run [gcloud auth application-default login] to configure them"
|
||||
exit 1
|
||||
fi
|
||||
docker run \
|
||||
-v "$HOME"/.config/gcloud:/root/.config/gcloud \
|
||||
-v "$context":/workspace \
|
||||
gcr.io/kaniko-project/executor:latest \
|
||||
--dockerfile "${dockerfile}" --destination "${destination}" --context dir:///workspace/ \
|
||||
--cache="${cache}"
|
||||
else
|
||||
docker run \
|
||||
-v "$context":/workspace \
|
||||
gcr.io/kaniko-project/executor:latest \
|
||||
--dockerfile "${dockerfile}" --destination "${destination}" --context dir:///workspace/ \
|
||||
--cache="${cache}"
|
||||
fi
|
||||
|
||||
docker run \
|
||||
-v "$HOME"/.config/gcloud:/root/.config/gcloud \
|
||||
-v "$context":/workspace \
|
||||
gcr.io/kaniko-project/executor:latest \
|
||||
--dockerfile "${dockerfile}" --destination "${destination}" --context dir:///workspace/ \
|
||||
--cache="${cache}"
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue