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:
|
workdir:
|
||||||
description: 'path to directory where kaniko is executed'
|
description: 'path to directory where kaniko is executed'
|
||||||
default: ''
|
default: ''
|
||||||
|
context:
|
||||||
|
description: 'path supplied to --context'
|
||||||
|
default: ''
|
||||||
runs:
|
runs:
|
||||||
using: docker
|
using: docker
|
||||||
image: Dockerfile
|
image: Dockerfile
|
||||||
|
|
|
@ -8,5 +8,10 @@ if [ -n "$INPUT_WORKDIR" ]; then
|
||||||
printf 'cd %s -> %s\n' "$OLDPWD" "$PWD"
|
printf 'cd %s -> %s\n' "$OLDPWD" "$PWD"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
context_flag=""
|
||||||
|
if [ -n "$INPUT_CONTEXT" ]; then
|
||||||
|
context_flag="--context $INPUT_CONTEXT"
|
||||||
|
fi
|
||||||
|
|
||||||
# Build container
|
# 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