Kaniko is Google's lightweight container builder. This simple shell-script-based plugin should work with woodpecker and drone.
Go to file
Kevin Dorner 45fde6371e
ci/woodpecker/tag/build_and_release Pipeline was successful Details
[skip ci] Enable strip v for auto-tagging
2022-09-12 12:47:44 +02:00
.woodpecker [skip ci] Enable strip v for auto-tagging 2022-09-12 12:47:44 +02:00
.gitignore Fork drone-kaniko / initial commit 2022-09-09 07:24:42 +02:00
Containerfile Remove unnecessary comment 2022-09-09 14:24:30 +02:00
LICENSE Fork drone-kaniko / initial commit 2022-09-09 07:24:42 +02:00
README.md Updated and simplified README.md 2022-09-12 12:00:36 +02:00
plugin.sh Simplify auto-tag functionality for now 2022-09-10 02:34:23 +02:00

README.md

plugin-kaniko

A thin shim-wrapper around the official Google Kaniko OCI image to make it behave similar to the Drone Docker plugin.

This is a fork of the discontinued drone-kaniko by banzaicloud.

Example .woodpecker.yml (pushing to Docker Hub):

pipeline:
  build_and_release:
    image: gitea.mdg-hamburg.de/ci-tools/plugin-kaniko:debug
    pull: true
    settings:
      registry: registry.example.com # docker.io is the default registry
      repo: example-org/example-project
      tags: ${CI_COMMIT_SHA},awesometag,latest
	  cache: true
      dockerfile: Containerfile
      username:
        from_secret: container_registry_username
      password:
        from_secret: container_registry_password

Example .drone.yml (pushing to Docker Hub):

kind: pipeline
name: default

steps:
- name: build_and_release
  image: gitea.mdg-hamburg.de/ci-tools/plugin-kaniko
  settings:
    registry: registry.example.com # docker.io is the default registry
    repo: example-org/example-project
    tags: ${DRONE_COMMIT_SHA},awesometag,latest
    cache: true
    username:
      from_secret: docker-username
    password:
      from_secret: docker-password

Pushing to Google Cloud Registry:

Instead of authenticating with username and password, you simply provide a json_key

...
  settings:
    json_key:
      from_secret: google_gcr_key
...

Using auto-tag

Woodpecker-only feature

This uses the current git tag as the container destination tag. The latest tag is also appended. Optionally with the tag_strip_v a leading v can be stripped from the container tag.

...
  settings:
    auto_tag: true
	tag_strip_v: false
...