Skip to main content

Repo2docker Kaniko builder

Project description

repo2kaniko

Build Status Container repository

repo2kaniko is a plugin for repo2docker that lets you use Kaniko instead of Docker.

Kaniko must run in a container, can only build images, and can only store images in a registry. It has the big advantage that it i completely unprivileged and doesn't require any host configuration, unlike e.g. Podman which requires your system to have the correct cgroups configuration.

It does not use a local Docker store, so it is not possible to separate the build and push steps. This means the repo2docker --push/--no-push arguments have no effect. The default in this plugin is to automatically push the image to a registry after it is built. Set Traitlet KanikoEngine.push_image=False or environment variable KANIKO_PUSH_IMAGE=0 to disable pushing the image.

Kaniko does not cache layers locally, instead it uses a registry for caching. You should probably use a dedicated local private registry for speed and not the remote registry used for storing the built image. Use KanikoEngine.cache_registry_credentials or KANIKO_CACHE_REGISTRY_CREDENTIALS to specify the credentials for the cache registry. These behave similarly to ContainerEngine.registry_credentials and CONTAINER_ENGINE_REGISTRY_CREDENTIALS.

Running

podman run -it --rm quay.io/manics/repo2kaniko \
    repo2docker --debug --engine=kaniko \
    --Repo2Docker.user_id=1000 --user-name=jovyan \
    --KanikoEngine.registry_credentials=registry=quay.io \
    --KanikoEngine.registry_credentials=username=quay-user \
    --KanikoEngine.registry_credentials=password=quay-password \
    --image-name=quay.io/quay-user/r2d-test \
    --no-run \
    https://github.com/binderhub-ci-repos/minimal-dockerfile

With a local registry that can be used as a cache:

./run-local-registry.sh
REGISTRY=...
podman run -it --rm quay.io/manics/repo2kaniko \
    repo2docker --debug --engine=kaniko \
    --Repo2Docker.user_id=1000 --user-name=jovyan \
    --KanikoEngine.cache_registry=$REGISTRY/cache \
    --KanikoEngine.cache_registry_credentials=username=user \
    --KanikoEngine.cache_registry_credentials=password=password \
    --KanikoEngine.cache_registry_insecure=true \
    --image-name=$REGISTRY/r2d-test \
    --no-run \
    https://github.com/binderhub-ci-repos/minimal-dockerfile

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

repo2kaniko-0.1.0.tar.gz (11.9 kB view hashes)

Uploaded Source

Built Distribution

repo2kaniko-0.1.0-py2.py3-none-any.whl (6.7 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page