diff --git a/.gitlab/ci/definitions.yml b/.gitlab/ci/definitions.yml index 79d5dd4..ab7651a 100644 --- a/.gitlab/ci/definitions.yml +++ b/.gitlab/ci/definitions.yml @@ -30,7 +30,7 @@ - gitlab-org stage: kaniko resource_group: ${CI_COMMIT_REF_SLUG}_${CI_JOB_NAME} - image: registry.gitlab.com/gitlab-org/frontend/frontend-build-images/build-image + image: registry.gitlab.com/gitlab-org/gitlab-build-images/unstable/kaniko:1.0.0-eb588d0f script: - pwd - ls diff --git a/kaniko/README.md b/kaniko/README.md index 0d9b3b3..898fd2d 100644 --- a/kaniko/README.md +++ b/kaniko/README.md @@ -1,3 +1,42 @@ # registry.gitlab.com/gitlab-org/gitlab-build-images/kaniko -This is a image around the `kaniko` executor \ No newline at end of file +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. + +[kaniko]: https://github.com/GoogleContainerTools/kaniko#readme +[crane]: https://github.com/google/go-containerregistry/blob/main/cmd/crane/doc/crane.md +[jq]: https://stedolan.github.io/jq/ + +## Usage + +GitLab Docs on usage of [kaniko](https://docs.gitlab.com/ee/ci/docker/using_kaniko.html). + +This image simplifies building with kaniko even further. `/kaniko/executor` and `/kaniko/warmer` are also +aliased to `kaniko-executor` and `kaniko-warmer`. + +```yaml +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 \ No newline at end of file