pipeline { agent { dockerfile true } stages { stage('Pull Alpine Image') { steps { script { // Pull the Alpine Docker image dockerImage = docker.image('alpine:latest') dockerImage.pull() } } } stage('Build') { steps { script { docker.withRegistry('https://git.adrianux.net/ahoemann/') { /* Build the container image */ def dockerImage = docker.build("adrianux:${env.BUILD_ID}") /* Push the container to the custom Registry */ dockerImage.push() } /* Remove docker image*/ sh 'docker rmi -f adrianux:${env.BUILD_ID}' } } } }