Bundling --context with arg in "" does not work
Try converting to bash to get access to arrays instead.
This commit is contained in:
parent
a516d1e2a2
commit
2138c52c9c
1 changed files with 5 additions and 4 deletions
|
@ -1,4 +1,4 @@
|
|||
#!/bin/sh
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Setup auth
|
||||
echo '{"auths":{"'"$(printf "%s" "$INPUT_REGISTRY")"'":{"auth":"'"$(printf "%s" "$INPUT_CREDENTIAL" | base64 | tr -d '\n')"'"}}}' > /kaniko/.docker/config.json
|
||||
|
@ -8,10 +8,11 @@ if [ -n "$INPUT_WORKDIR" ]; then
|
|||
printf 'cd %s -> %s\n' "$OLDPWD" "$PWD"
|
||||
fi
|
||||
|
||||
context_flag=""
|
||||
options=()
|
||||
if [ -n "$INPUT_CONTEXT" ]; then
|
||||
context_flag="--context $INPUT_CONTEXT"
|
||||
options+=('--context')
|
||||
options+=("$INPUT_CONTEXT")
|
||||
fi
|
||||
|
||||
# Build container
|
||||
/kaniko/executor --dockerfile "$INPUT_DOCKERFILE" --destination "$INPUT_REGISTRY/$INPUT_IMAGE" "$context_flag"
|
||||
/kaniko/executor --dockerfile "$INPUT_DOCKERFILE" --destination "$INPUT_REGISTRY/$INPUT_IMAGE" "${options[@]}"
|
||||
|
|
Loading…
Add table
Reference in a new issue