跳转到主要内容

Repo2docker Kaniko构建器

项目描述

repo2kaniko

Build Status Container repository

repo2kaniko 是一个用于 repo2docker 的插件,允许您使用 Kaniko 而不是Docker。

Kaniko必须在容器中运行,只能构建镜像,并且只能将镜像存储在仓库中。它有一个大优势,那就是它完全无特权的,并且不需要任何主机配置,与例如Podman需要您的系统有正确的cgroups配置不同。

它不使用本地Docker存储,因此无法将构建和推送步骤分开。 这意味着repo2docker的--push/--no-push参数没有任何效果。 在此插件中,默认情况下会在构建后自动将镜像推送到仓库。设置Traitlet KanikoEngine.push_image=False 或环境变量 KANIKO_PUSH_IMAGE=0 以禁用推送镜像。

Kaniko不本地缓存层,而是使用仓库进行缓存。您可能需要使用专用本地私有仓库以获得速度,而不是用于存储构建镜像的远程仓库。使用 KanikoEngine.cache_registry_credentialsKANIKO_CACHE_REGISTRY_CREDENTIALS 指定缓存仓库的凭据。这些与 ContainerEngine.registry_credentialsCONTAINER_ENGINE_REGISTRY_CREDENTIALS 类似。

运行

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

使用可作为缓存使用的本地仓库

./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

项目详情


下载文件

下载您平台对应的文件。如果您不确定选择哪个,请了解更多关于 安装包 的信息。

源代码分发

repo2kaniko-0.1.0.tar.gz (11.9 kB 查看哈希值)

上传时间 源代码

构建分发

repo2kaniko-0.1.0-py2.py3-none-any.whl (6.7 kB 查看哈希值)

上传时间 Python 2 Python 3

由以下支持