12 lines
411 B
Bash
12 lines
411 B
Bash
#!/bin/sh
|
|
|
|
# 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"
|