mirror of
https://ops.gitlab.net/gitlab-org/gitlab-build-images.git
synced 2025-12-12 19:42:55 +01:00
42 lines
No EOL
1.6 KiB
Markdown
42 lines
No EOL
1.6 KiB
Markdown
# 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.
|
|
|
|
[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 |