#!groovy def repository = "registry.c.test-chamber-13.lan" def repositoryCreds = "harbor-repository-creds" def dockerFile = """FROM ${repository}/google/kaniko-project/executor:debug COPY ./kaniko-chain.crt /kaniko/ssl/certs/ca-certificates.crt """ def label = "kubernetes-${UUID.randomUUID().toString()}" def templateName = "pipeline-worker" podTemplate ( label: label, name: templateName, yaml: functions.podYaml( repo: repository, templateName: templateName, [ [ name: "kaniko", image: "${repository}/google/kaniko-project/executor:debug", command: "/busybox/sh" ] ] ) ){ node (label) { def workspace = pwd() writeFile(file: workspace + "/test-chamber-13.lan.root.crt", text: functions.getLocalRootCA()) stage ("Add Cert to Kaniko") { container ("kaniko") { sh """ printf '%s\\n' "${functions.getLocalRootCA)" >> /kaniko/ssl/certs/ca-certificates.crt cp "/kaniko/ssl/certs/ca-certificates.crt" "${workspace}/kaniko-chain.crt" """ } } functions.buildContainer( repository: repository, imageDest: "${repository}/library/kaniko:latest", dockerFile: dockerFile, repoCreds: repositoryCreds, ) } }