gitlab-build-images/kaniko
Lukas Eipert 596d6b643d meh
2022-02-21 18:08:02 +01:00
..
.gitlab-ci.yml meh 2022-02-21 18:08:02 +01:00
build.sh meh 2022-02-21 18:08:02 +01:00
Dockerfile kaniko 2022-02-21 18:02:01 +01:00
entry_point.sh kaniko 2022-02-21 18:02:01 +01:00
README.md Finally bootstrapping? 2022-02-21 17:23:56 +01:00
VERSION Initial version new build pattern 2022-02-21 14:50:31 +01:00

registry.gitlab.com/gitlab-org/gitlab-build-images/kaniko

This is an image that wraps and extends kaniko. It contains the following tools:

  • kaniko: A tool to build images in Docker / Kubernetes
  • crane: A tool for managing container images (without the need to download them from registries)
  • jq: a lightweight and flexible command-line JSON processor

With this image you can build images without the need for Docker-in-Docker. The image is based on alpine:git, so you can utilize apk and git as well.

If you use this image in GitLab CI, it automatically logs in with credentials provided in GitLab CI.

Usage

GitLab Docs on usage of kaniko.

This image simplifies building with kaniko even further. /kaniko/executor and /kaniko/warmer are also aliased to kaniko-executor and kaniko-warmer.

build:
  stage: build
  image: registry.gitlab.com/gitlab-org/gitlab-build-images/kaniko
  script:
    - >-
      kaniko-executor
      --context "${CI_PROJECT_DIR}"
      --dockerfile "${CI_PROJECT_DIR}/Dockerfile"
      --destination "${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}"
  rules:
    - if: $CI_COMMIT_TAG

Environment variables

  • BUILD_IMAGE_NO_MESSAGE: per default prints a message with version information, set this variable to suppress it
  • BUILD_IMAGE_NO_AUTO_LOGIN: per default authenticating against the registry, set this variable to suppress this