mirror of
https://github.com/GoogleContainerTools/kaniko.git
synced 2026-05-16 13:20:33 +00:00
Fixes #988 run_in_docker.sh only works with gcr.io
This commit is contained in:
+17
-11
@@ -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}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user