From b004137b94d9c544b0b2d0512e7fabc25d0e616d Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Sat, 11 Jun 2022 18:37:57 +0200 Subject: [PATCH] Readme --- README.md | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..8e171ef --- /dev/null +++ b/README.md @@ -0,0 +1,108 @@ +# Drone Kaniko + +A thin shim-wrapper around the official [Google Kaniko](https://cloud.google.com/blog/products/gcp/introducing-kaniko-build-container-images-in-kubernetes-and-google-container-builder-even-without-root-access) Docker image to make it behave like the [Drone Docker plugin](http://plugins.drone.io/drone-plugins/drone-docker/). + +Based on the original [drone-kaniko](https://github.com/banzaicloud/drone-kaniko) by [Banzai Cloud](https://github.com/banzaicloud) +Modified by [ODIT.Services](https://odit.services) to enable local builds to tar. + + +## Settings +TODO: + +## Examples + +```yaml +kind: pipeline +name: default + +steps: +- name: publish + image: TODO:ImageName + 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: + +```yaml +kind: pipeline +name: default + +steps: +- name: publish + image: TODO:ImageName + 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](https://github.com/drone-plugins/drone-docker) plugin you can use +`.tags` file to embed some custom logic for creating tags for an image. + +```yaml +kind: pipeline +name: default + +steps: +- name: build + image: golang + commands: + - go get + - go build + - make versiontags > .tags +- name: publish + image: TODO:ImageName + 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`. + +```yaml +kind: pipeline +name: default + +steps: +- name: build + image: golang + commands: + - go get + - go build +- name: publish + image: TODO:ImageName + 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 +``` \ No newline at end of file