2024-10-04 12:42:09 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Setup auth
|
|
|
|
echo '{"auths":{"'"$(printf "%s" "$INPUT_REGISTRY")"'":{"auth":"'"$(printf "%s" "$INPUT_CREDENTIAL" | base64 | tr -d '\n')"'"}}}' > /kaniko/.docker/config.json
|
|
|
|
|
2025-02-05 19:44:39 +01:00
|
|
|
if [ -n "$INPUT_WORKDIR" ]; then
|
|
|
|
cd "$INPUT_WORKDIR" || exit 1
|
2025-02-05 19:47:43 +01:00
|
|
|
printf 'cd %s -> %s\n' "$OLDPWD" "$PWD"
|
2025-02-05 19:44:39 +01:00
|
|
|
fi
|
|
|
|
|
2024-10-04 12:42:09 +02:00
|
|
|
# Build container
|
2025-02-05 19:44:39 +01:00
|
|
|
/kaniko/executor --dockerfile "$INPUT_DOCKERFILE" --destination "$INPUT_REGISTRY/$INPUT_IMAGE"
|