Try supporting a workdir
This is where kaniko is executed.
This commit is contained in:
parent
4a8753d498
commit
6afbf1ce25
2 changed files with 9 additions and 1 deletions
|
@ -12,6 +12,9 @@ inputs:
|
|||
dockerfile:
|
||||
description: 'path to Dockerfile'
|
||||
default: 'Dockerfile'
|
||||
workdir:
|
||||
description: 'path to directory where kaniko is executed'
|
||||
default: ''
|
||||
runs:
|
||||
using: docker
|
||||
image: Dockerfile
|
||||
|
|
|
@ -3,5 +3,10 @@
|
|||
# Setup auth
|
||||
echo '{"auths":{"'"$(printf "%s" "$INPUT_REGISTRY")"'":{"auth":"'"$(printf "%s" "$INPUT_CREDENTIAL" | base64 | tr -d '\n')"'"}}}' > /kaniko/.docker/config.json
|
||||
|
||||
if [ -n "$INPUT_WORKDIR" ]; then
|
||||
cd "$INPUT_WORKDIR" || exit 1
|
||||
printf 'cd %s -> %s' "$OLDPWD" "$PWD"
|
||||
fi
|
||||
|
||||
# Build container
|
||||
/kaniko/executor --dockerfile $INPUT_DOCKERFILE --destination "$INPUT_REGISTRY/$INPUT_IMAGE"
|
||||
/kaniko/executor --dockerfile "$INPUT_DOCKERFILE" --destination "$INPUT_REGISTRY/$INPUT_IMAGE"
|
||||
|
|
Loading…
Add table
Reference in a new issue