diff --git a/knowledge base/kaniko.md b/knowledge base/kaniko.md index 99a449d..6a4fb14 100644 --- a/knowledge base/kaniko.md +++ b/knowledge base/kaniko.md @@ -3,6 +3,7 @@ Tool to build container images from a Dockerfile with**out** the need of the Docker engine. 1. [TL;DR](#tldr) +1. [Usage in GitLab pipelines](#usage-in-gitlab-pipelines) 1. [Further readings](#further-readings) 1. [Sources](#sources) @@ -59,7 +60,7 @@ docker run … \ --destination 'gcr.io/gcp-project-id/custom-image:1.2.3' \ --destination 'mycr.azurecr.io/azure-repository:1.2.3' docker run … -v "$PWD/config.json:/kaniko/.docker/config.json:ro" 'gcr.io/kaniko-project/executor:latest' -docker run … 'gcr.io/kaniko-project/executor' … --cache true --custom-platform 'linux/amd64' +docker run … 'gcr.io/kaniko-project/executor' … --cache true --custom-platform 'linux/amd64' --build-arg VERSION='1.2' ``` @@ -75,6 +76,21 @@ docker run --rm -ti -v "$PWD:/workspace" --entrypoint '' 'gcr.io/kaniko-project/ +## Usage in GitLab pipelines + +```yaml +build-container: + stage: build + image: + name: gcr.io/kaniko-project/executor:debug + entrypoint: [""] + script: + - >- + /kaniko/executor + --context "${CI_PROJECT_DIR}" + --destination "${CI_REGISTRY_IMAGE}:latest" +``` + ## Further readings - [Main repository]