#!/usr/bin/env groovy POD_LABEL = "jenkins-builder-${UUID.randomUUID()}" REGISTRY = 'docker.home.thejimnicholson.com/jenkins' podTemplate(label: POD_LABEL, containers: [ containerTemplate( name: 'kaniko', image: 'gcr.io/kaniko-project/executor:debug', command: 'sleep', args: '30d' ) ], workspaceVolume: dynamicPVC()) { node(POD_LABEL) { stage('Checkout') { checkout scm } container('kaniko') { stage('Image') { ansiColor('xterm') { sh "/kaniko/executor \ -f `pwd`/Dockerfile \ -c `pwd` \ --insecure \ --skip-tls-verify \ \ --destination=${REGISTRY}/jenkins:2.333 \ --destination=${REGISTRY}/jenkins:${GIT_HASH} \ --destination=${REGISTRY}/jenkins:latest" } } } } }