A thin shim-wrapper around the official Google Kaniko Docker image to make it behave like the Drone Docker plugin.
Go to file
Nandor Kracser 3e6f728533 Add caching example 2018-11-25 15:59:05 +01:00
.gitignore Add caching example 2018-11-25 15:59:05 +01:00
Dockerfile Add build_args support 2018-11-23 09:03:11 +01:00
Dockerfile.test Add caching example 2018-11-25 15:59:05 +01:00
LICENSE Initial commit 2018-11-21 07:39:41 +01:00
README.md Add caching example 2018-11-25 15:59:05 +01:00
plugin.sh Add build_args support 2018-11-23 09:03:11 +01:00

README.md

kaniko-plugin

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

Test that it can build

docker run -it --rm -w /src -v $PWD:/src -e DOCKER_USERNAME=${DOCKER_USERNAME} -e DOCKER_PASSWORD=${DOCKER_PASSWORD} -e PLUGIN_REPO=banzaicloud/kaniko-plugin-test -e PLUGIN_TAGS=test -e PLUGIN_DOCKERFILE=Dockerfile.test banzaicloud/kaniko-plugin

Test that caching works

Start a Docker registry at 127.0.0.1:5000:

docker run -d -p 5000:5000 --restart always --name registry --hostname registry.local registry:2

Add the following lines to plugin.sh's final command and build a new image from it:

+    --cache=true \
+    --cache-repo=127.0.0.1:5000/${PLUGIN_REPO} \
docker build -t banzaicloud/kaniko-plugin .

Warm up the alpine image to the cache:

docker run -v $PWD:/cache gcr.io/kaniko-project/warmer:latest --image=alpine:3.8

Run the builder on the host network to be able to access the registry:

docker run --net=host -it --rm -w /src -v $PWD:/cache -v $PWD:/src -e DOCKER_USERNAME=${DOCKER_USERNAME} -e DOCKER_PASSWORD=${DOCKER_PASSWORD} -e PLUGIN_REPO=banzaicloud/kaniko-plugin-test -e PLUGIN_TAGS=test -e PLUGIN_DOCKERFILE=Dockerfile.test banzaicloud/kaniko-plugin