From 18bcc005b97346adda50ca5a62a1ddc8e7db2dd8 Mon Sep 17 00:00:00 2001 From: The_Spider Date: Sat, 22 May 2021 19:11:45 +0000 Subject: [PATCH] Update 'build-alpine.jenkins' --- build-alpine.jenkins | 44 ++++++++++++++++++++------------------------ 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/build-alpine.jenkins b/build-alpine.jenkins index 1c371cd..b02a02f 100644 --- a/build-alpine.jenkins +++ b/build-alpine.jenkins @@ -1,26 +1,8 @@ def label = "jenkins-${UUID.randomUUID().toString()}" -def repository = "registry.test-chamber-13.lan" -def kanikoImage = "${repository}/nhyatt/kaniko:latest" -def repositoryCreds = "quay-repository-creds" - -def caName = "test-chamber-13.lan.root.crt" -def caContent = """ ------BEGIN CERTIFICATE----- -MIICLTCCAbOgAwIBAgIDAYagMAoGCCqGSM49BAMEME0xCzAJBgNVBAYTAlVTMScw -JQYDVQQKDB5UZXN0IENoYW1iZXIgMTMgVHJ1c3QgU2VydmljZXMxFTATBgNVBAMM -DFRDMTMgUm9vdCBSMTAgFw0xOTAxMDEwMDAwMDBaGA8yMDUwMDEwMTAwMDAwMFow -TTELMAkGA1UEBhMCVVMxJzAlBgNVBAoMHlRlc3QgQ2hhbWJlciAxMyBUcnVzdCBT -ZXJ2aWNlczEVMBMGA1UEAwwMVEMxMyBSb290IFIxMHYwEAYHKoZIzj0CAQYFK4EE -ACIDYgAE8+/J1ECc0VHxTtGXFLnHJ3NGZ2SW38pp9wI58L5EQbHRLiezYuvkUbI/ -XGJjLnFdpgjo7W1FFlyhx5ITlCstUX5Sn9bLZiA0+mE0n6b8VwhXwkHlnIeRo7od -Zu/OfSFjo2MwYTAdBgNVHQ4EFgQUrGqUJhyRp93wXF645VNtYatRk/AwHwYDVR0j -BBgwFoAUrGqUJhyRp93wXF645VNtYatRk/AwDwYDVR0TAQH/BAUwAwEB/zAOBgNV -HQ8BAf8EBAMCAYYwCgYIKoZIzj0EAwQDaAAwZQIxAJdgskimDJkf/MGVRrKotmNC -xdH/UVQfQppjIR9FAiGeFDr47thclYrzIL6yCkV7nwIwYjf3MbOm/yWblzqe3Uyw -UOemMEg3PjcKNsN65W2WVon5HIZx2XVfGRPjf5ZTVWzZ ------END CERTIFICATE----- -""" +def repository = "registry.cluster.test-chamber-13.lan" +def kanikoImage = "${repository}/kaniko/kaniko:latest" +def repositoryCreds = "harbor-repository-creds" podTemplate( label: label, @@ -66,9 +48,23 @@ spec: stage("Build Alpine with CA") { container("kaniko") { - def DF = """FROM alpine:latest -COPY ${caName} /usr/local/share/ca-certificates/ -RUN apk add --no-cache --virtual=.packagecache ca-certificates && \\ + def DF = """FROM ${repository}/library/alpine:latest + +RUN printf '%s\n' "-----BEGIN CERTIFICATE-----" \\ + "MIICLTCCAbOgAwIBAgIDAYagMAoGCCqGSM49BAMEME0xCzAJBgNVBAYTAlVTMScw" \\ + "JQYDVQQKDB5UZXN0IENoYW1iZXIgMTMgVHJ1c3QgU2VydmljZXMxFTATBgNVBAMM" \\ + "DFRDMTMgUm9vdCBSMTAgFw0xOTAxMDEwMDAwMDBaGA8yMDUwMDEwMTAwMDAwMFow" \\ + "TTELMAkGA1UEBhMCVVMxJzAlBgNVBAoMHlRlc3QgQ2hhbWJlciAxMyBUcnVzdCBT" \\ + "ZXJ2aWNlczEVMBMGA1UEAwwMVEMxMyBSb290IFIxMHYwEAYHKoZIzj0CAQYFK4EE" \\ + "ACIDYgAE8+/J1ECc0VHxTtGXFLnHJ3NGZ2SW38pp9wI58L5EQbHRLiezYuvkUbI/" \\ + "XGJjLnFdpgjo7W1FFlyhx5ITlCstUX5Sn9bLZiA0+mE0n6b8VwhXwkHlnIeRo7od" \\ + "Zu/OfSFjo2MwYTAdBgNVHQ4EFgQUrGqUJhyRp93wXF645VNtYatRk/AwHwYDVR0j" \\ + "BBgwFoAUrGqUJhyRp93wXF645VNtYatRk/AwDwYDVR0TAQH/BAUwAwEB/zAOBgNV" \\ + "HQ8BAf8EBAMCAYYwCgYIKoZIzj0EAwQDaAAwZQIxAJdgskimDJkf/MGVRrKotmNC" \\ + "xdH/UVQfQppjIR9FAiGeFDr47thclYrzIL6yCkV7nwIwYjf3MbOm/yWblzqe3Uyw" \\ + "UOemMEg3PjcKNsN65W2WVon5HIZx2XVfGRPjf5ZTVWzZ" \\ + "-----END CERTIFICATE-----" > /usr/local/share/ca-certificates/test-chamber-13.lan.root.crt && \\ + add --no-cache --virtual=.packagecache ca-certificates && \\ update-ca-certificates --fresh && \\ apk del .packagecache """