Compare commits
No commits in common. "20209e6c170594b474d1b5ec02e6ffb0a178c679" and "8060274e8f65b506f68df4c3f0beac7e9888f687" have entirely different histories.
20209e6c17
...
8060274e8f
2 changed files with 8 additions and 20 deletions
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
|
@ -1,3 +0,0 @@
|
||||||
{
|
|
||||||
"cSpell.words": ["elif", "kaniko"]
|
|
||||||
}
|
|
25
action.yml
25
action.yml
|
@ -1,17 +1,17 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
name: Kaniko
|
name: Kaniko
|
||||||
description: Build a container image using Kaniko
|
description: Build a container image using Kaniko
|
||||||
inputs:
|
inputs:
|
||||||
dockerfile:
|
Dockerfile:
|
||||||
description: The Dockerfile to pass to Kaniko
|
description: The Dockerfile to pass to Kaniko
|
||||||
required: false
|
required: true
|
||||||
image:
|
image:
|
||||||
description: Name and tag under which to upload the image
|
description: Name and tag under which to upload the image
|
||||||
required: true
|
required: true
|
||||||
registry:
|
registry:
|
||||||
description: Domain of the registry. Should be the same as the first path component of the tag.
|
description: Domain of the registry. Should be the same as the first path component of the tag.
|
||||||
required: false
|
required: true
|
||||||
default: https://index.docker.io/v1/
|
|
||||||
username:
|
username:
|
||||||
description: Username for the container registry
|
description: Username for the container registry
|
||||||
required: true
|
required: true
|
||||||
|
@ -27,16 +27,7 @@ runs:
|
||||||
- |
|
- |
|
||||||
mkdir -p /kaniko/.docker
|
mkdir -p /kaniko/.docker
|
||||||
echo '{"auths":{"${{ inputs.registry }}":{"auth":"'$(printf "%s:%s" "${{ inputs.username }}" "${{ inputs.password }}" | base64 | tr -d '\n')'"}}}' > /kaniko/.docker/config.json
|
echo '{"auths":{"${{ inputs.registry }}":{"auth":"'$(printf "%s:%s" "${{ inputs.username }}" "${{ inputs.password }}" | base64 | tr -d '\n')'"}}}' > /kaniko/.docker/config.json
|
||||||
|
cat > Dockerfile <<EOF
|
||||||
if [ -n "${{ inputs.dockerfile }}" ]; then
|
${{ inputs.Dockerfile }}
|
||||||
echo "Using Dockerfile from input"
|
EOF
|
||||||
echo "${{ inputs.dockerfile }}" > Dockerfile
|
/kaniko/executor --dockerfile Dockerfile --destination ${{ inputs.image }}
|
||||||
elif [ -f "./Dockerfile" ]; then
|
|
||||||
echo "Using existing ./Dockerfile from workspace"
|
|
||||||
cp ./Dockerfile Dockerfile
|
|
||||||
else
|
|
||||||
echo "ERROR: No Dockerfile provided and no ./Dockerfile found in workspace"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
/kaniko/executor --dockerfile Dockerfile --destination "${{ inputs.image }}"
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue