Initial commit

This commit is contained in:
Patrik Lundin 2024-10-04 12:42:09 +02:00
commit 2088faeaa6
Signed by: patlu
GPG key ID: A0A812BA2249F294
4 changed files with 32 additions and 0 deletions

6
Dockerfile Normal file
View file

@ -0,0 +1,6 @@
FROM gcr.io/kaniko-project/executor:debug
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

5
README.md Normal file
View file

@ -0,0 +1,5 @@
# runner-action-kaniko
Used to build container image from Dockerfile with kaniko. Using kaniko means
we do not need to make the outer docker daemon available to the inner runner
containers.

14
action.yml Normal file
View file

@ -0,0 +1,14 @@
inputs:
credential:
description: 'a string containing username and password: username:password'
required: true
registry:
description: 'the name of the registry'
required: true
default: 'platform.sunet.se'
image:
description: 'name of the image: org-name/container-name:latest'
required: true
runs:
using: docker
image: Dockerfile

7
entrypoint.sh Normal file
View file

@ -0,0 +1,7 @@
#!/bin/sh
# Setup auth
echo '{"auths":{"'"$(printf "%s" "$INPUT_REGISTRY")"'":{"auth":"'"$(printf "%s" "$INPUT_CREDENTIAL" | base64 | tr -d '\n')"'"}}}' > /kaniko/.docker/config.json
# Build container
/kaniko/executor --dockerfile Dockerfile --destination "$INPUT_REGISTRY/$INPUT_IMAGE"