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
"""
}