26 lines
577 B
Bash
Executable File
26 lines
577 B
Bash
Executable File
#!/bin/bash -e
|
|
|
|
exec 3<> /dev/tty
|
|
|
|
cat <<EOF >&3
|
|
{
|
|
"auths": {
|
|
"$ACTION_REGISTRY": {
|
|
"username": "$ACTION_USERNAME",
|
|
"password": "$ACTION_PASSWORD"
|
|
}
|
|
}
|
|
}
|
|
EOF
|
|
|
|
REGISTRY="${ACTION_REGISTRY/https:\/\/}"
|
|
docker run --rm \
|
|
-v "$PWD:$PWD:ro" \
|
|
-v "$HOME/.cache/kaniko:/cache" \
|
|
-v "/proc/$$/fd/3:/kaniko/.docker/config.json:ro" \
|
|
gcr.io/kaniko-project/executor:latest \
|
|
--cache true \
|
|
--context "${ACTION_DOCKERFILE%/*}" \
|
|
--dockerfile "$ACTION_DOCKERFILE" \
|
|
--destination "$REGISTRY/$ACTION_IMAGE:$ACTION_TAG"
|