diff --git a/entrypoint.sh b/entrypoint.sh index da48f30..cbba054 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh # Setup auth echo '{"auths":{"'"$(printf "%s" "$INPUT_REGISTRY")"'":{"auth":"'"$(printf "%s" "$INPUT_CREDENTIAL" | base64 | tr -d '\n')"'"}}}' > /kaniko/.docker/config.json @@ -8,11 +8,11 @@ if [ -n "$INPUT_WORKDIR" ]; then printf 'cd %s -> %s\n' "$OLDPWD" "$PWD" fi -options=() +context_flag="" if [ -n "$INPUT_CONTEXT" ]; then - options+=('--context') - options+=("$INPUT_CONTEXT") + context_flag="--context" + context_flag_val="$INPUT_CONTEXT" fi # Build container -/kaniko/executor --dockerfile "$INPUT_DOCKERFILE" --destination "$INPUT_REGISTRY/$INPUT_IMAGE" "${options[@]}" +/kaniko/executor --dockerfile "$INPUT_DOCKERFILE" --destination "$INPUT_REGISTRY/$INPUT_IMAGE" "$context_flag" "$context_flag_val"