Added GOPROXY settings
authorErik Brakkee <erik@brakkee.org>
Sun, 17 Nov 2024 19:07:32 +0000 (20:07 +0100)
committerErik Brakkee <erik@brakkee.org>
Sun, 17 Nov 2024 19:07:32 +0000 (20:07 +0100)
vars/buildcontainer.groovy

index a77493fad0b57b532cf1e56d1b8babe76169631f..98fe94ee1df1d394d26ed45964aab99fcbf33d56 100644 (file)
@@ -30,7 +30,13 @@ def call(Map args) {
   container('kaniko') { 
     sh """
       echo "Building container with settings: ${args}"
-      /kaniko/executor $mirrorArg --dockerfile ${args.dockerfile} --cache=${args.cache} --cache-ttl=${args.cachettl} --context \$(  pwd )/${args.context} --destination ${args.repo}/${args.container}:${args.version}
+      /kaniko/executor $mirrorArg \\
+         --build-arg GOPROXY="$GOPROXY" \\
+         --build-arg GOSUMDB="$GTOSUMDB" \\
+         --dockerfile ${args.dockerfile} \\
+         --cache=${args.cache} --cache-ttl=${args.cachettl} \\
+         --context \$(  pwd )/${args.context} \\
+         --destination ${args.repo}/${args.container}:${args.version}
       rm -rf /kaniko/*[0-9]* && rm -rf /kaniko/Dockerfile && mkdir -p /workspace
     """
   }