A thin shim-wrapper around Google Kaniko to make it behave like the Drone Docker plugin
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Nicolai Ort 12f6917c39
Revert "Merge pull request 'Update gcr.io/kaniko-project/executor Docker tag to v1.9.0' (#28) from renovate/gcr.io-kaniko-project-executor-1.x into main"
3 months ago
.drone.yml Removed overhead from dockerfile 6 months ago
.gitignore Basic gitignore 6 months ago
Dockerfile Revert "Merge pull request 'Update gcr.io/kaniko-project/executor Docker tag to v1.9.0' (#28) from renovate/gcr.io-kaniko-project-executor-1.x into main" 3 months ago
LICENSE Switched License to MIT 6 months ago
README.md Small readme update 6 months ago
plugin.sh Copy-paste mistake 6 months ago
renovate.json Basic Renovate config 6 months ago

README.md

ODIT Logo

Drone Kaniko

Drone (self-hosted) with branch

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

Based on the original drone-kaniko by Banzai Cloud Modified by ODIT.Services to enable local builds to tar.

Settings 🛠

  • registry: Your registry (defaults to docker hub)
  • repo: The image repository
  • tags: The image tags (as a simple string or an array)
  • username: Username for the chosen docker registry
  • password: Password for the chosen docker registry
  • nopush: Disable Pushing to registry (boolean)
  • tarpath: Export the image to tar (relative path)
  • cache: Use cached intermediate containers (boolean)
  • newrun: Use the experimental run implementation for detecting changes without requiring file system snapshots. (boolean)
  • snapshot_mode: Set how kaniko will snapshot the filesystem (full,redo,time).
  • skip_tls_verify: Skip SSL/TLS certificate verification (boolean)
  • build_args: Pass custom arguments to docker build
  • build_args_from_env: Pass the envvars as custom arguments to docker build
  • json_key: Provide registry auth data via json_key (mostly for gcr)
  • auto_tag: generate tag names automatically based on git branch and git tag

Examples

kind: pipeline
name: default

steps:
- name: publish
  image: registry.odit.services/library/drone-kaniko
  settings:
    registry: registry.example.com # if not provided index.docker.io is supposed
    repo: registry.example.com/example-project
    tags: ${DRONE_COMMIT_SHA}
    cache: true
    skip_tls_verify: false # set to true for testing registries ONLY with self-signed certs
    build_args:
    - COMMIT_SHA=${DRONE_COMMIT_SHA}
    - COMMIT_AUTHOR_EMAIL=${DRONE_COMMIT_AUTHOR_EMAIL}
    username:
      from_secret: docker-username
    password:
      from_secret: docker-password

Pushing to GCR:

kind: pipeline
name: default

steps:
- name: publish
  image: registry.odit.services/library/drone-kaniko
  settings:
    registry: gcr.io
    repo: example.com/example-project
    tags: ${DRONE_COMMIT_SHA}
    cache: true
    json_key:
      from_secret: google-application-credentials

Use .tags file for tagging

Similarily to official drone-docker plugin you can use .tags file to embed some custom logic for creating tags for an image.

kind: pipeline
name: default

steps:
- name: build
  image: golang
  commands:
      - go get 
      - go build
      - make versiontags > .tags
- name: publish
  image: registry.odit.services/library/drone-kaniko
  settings:
    registry: registry.example.com 
    repo: registry.example.com/example-project
    # tags: ${DRONE_COMMIT_SHA} <= it must be left undefined 
    username:
      from_secret: docker-username
    password:
      from_secret: docker-password

Auto tag

Set auto_tag: true.

kind: pipeline
name: default

steps:
- name: build
  image: golang
  commands:
      - go get 
      - go build
- name: publish
  image: registry.odit.services/library/drone-kaniko
  settings:
    registry: registry.example.com 
    repo: registry.example.com/example-project
    auto_tag: true # higher priority then .tags file
    # tags: ${DRONE_COMMIT_SHA} <= it must be left undefined to use auto_tag
    username:
      from_secret: docker-username
    password:
      from_secret: docker-password