Drone plugin for building and publishing Docker images using kaniko + personal patches
Go to file
Shubham Agrawal dbd6efc157
Add option to provide log verbosity (#23)
2021-08-20 16:38:35 +05:30
.github Working kaniko publish to docker 2020-11-16 23:41:59 +05:30
cmd Add option to provide log verbosity (#23) 2021-08-20 16:38:35 +05:30
docker add support for public ecr (#20) 2021-04-27 00:05:18 +05:30
scripts Fix ecr publish 2020-12-02 15:17:28 +05:30
.drone.yml Updated drone yml to update docker latest image (#15) 2021-03-19 17:46:22 +05:30
.gitignore Initial kaniko docker 2020-11-16 23:07:13 +05:30
LICENSE Initial kaniko docker 2020-11-16 23:07:13 +05:30
README.md Add snapshot mode support (#13) 2021-03-02 21:15:44 +05:30
go.mod Working kaniko publish to docker 2020-11-16 23:41:59 +05:30
go.sum Working kaniko publish to docker 2020-11-16 23:41:59 +05:30
kaniko.go Add option to provide log verbosity (#23) 2021-08-20 16:38:35 +05:30
kaniko_test.go Working kaniko publish to docker 2020-11-16 23:41:59 +05:30

drone-kaniko

Drone kaniko plugin uses kaniko to build and publish Docker images to a container registry.

Build

Build the binaries with the following commands:

export GOOS=linux
export GOARCH=amd64
export CGO_ENABLED=0
export GO111MODULE=on

go build -v -a -tags netgo -o release/linux/amd64/kaniko-docker ./cmd/kaniko-docker
go build -v -a -tags netgo -o release/linux/amd64/kaniko-gcr ./cmd/kaniko-gcr
go build -v -a -tags netgo -o release/linux/amd64/kaniko-ecr ./cmd/kaniko-ecr

Docker

Build the Docker images with the following commands:

docker build \
  --label org.label-schema.build-date=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
  --label org.label-schema.vcs-ref=$(git rev-parse --short HEAD) \
  --file docker/docker/Dockerfile.linux.amd64 --tag plugins/kaniko .

docker build \
  --label org.label-schema.build-date=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
  --label org.label-schema.vcs-ref=$(git rev-parse --short HEAD) \
  --file docker/gcr/Dockerfile.linux.amd64 --tag plugins/kaniko-gcr .

docker build \
  --label org.label-schema.build-date=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
  --label org.label-schema.vcs-ref=$(git rev-parse --short HEAD) \
  --file docker/ecr/Dockerfile.linux.amd64 --tag plugins/kaniko-ecr .

Usage

docker run --rm \
    -e PLUGIN_TAGS=1.2,latest \
    -e PLUGIN_DOCKERFILE=/drone/Dockerfile \
    -e PLUGIN_REPO=foo/bar \
    -e PLUGIN_USERNAME=foo \
    -e PLUGIN_PASSWORD=bar \
    -v $(pwd):/drone \
    -w /drone \
    plugins/kaniko:linux-amd64