Add support for setting --context
This commit is contained in:
parent
721c7174d7
commit
a516d1e2a2
2 changed files with 9 additions and 1 deletions
|
@ -15,6 +15,9 @@ inputs:
|
|||
workdir:
|
||||
description: 'path to directory where kaniko is executed'
|
||||
default: ''
|
||||
context:
|
||||
description: 'path supplied to --context'
|
||||
default: ''
|
||||
runs:
|
||||
using: docker
|
||||
image: Dockerfile
|
||||
|
|
|
@ -8,5 +8,10 @@ if [ -n "$INPUT_WORKDIR" ]; then
|
|||
printf 'cd %s -> %s\n' "$OLDPWD" "$PWD"
|
||||
fi
|
||||
|
||||
context_flag=""
|
||||
if [ -n "$INPUT_CONTEXT" ]; then
|
||||
context_flag="--context $INPUT_CONTEXT"
|
||||
fi
|
||||
|
||||
# Build container
|
||||
/kaniko/executor --dockerfile "$INPUT_DOCKERFILE" --destination "$INPUT_REGISTRY/$INPUT_IMAGE"
|
||||
/kaniko/executor --dockerfile "$INPUT_DOCKERFILE" --destination "$INPUT_REGISTRY/$INPUT_IMAGE" "$context_flag"
|
||||
|
|
Loading…
Add table
Reference in a new issue