pipeline { environment { imageObject = '' imageName = 'jenkins/sos-milter' dockerRegistry = 'https://dockreg-fra.zwackl.de' } agent any stages { stage('Build image') { steps { sh '/usr/bin/env' /* This builds the actual image; synonymous to * docker build on the command line */ script { imageObject = docker.build(imageName) } } } stage('Test image') { steps { /* Ideally, we would run a test framework against our image. * For this example, we're using a Volkswagen-type approach ;-) */ script { imageObject.inside { sh 'echo "Tests passed"' } } } } stage('Push image') { steps { script { /* docker.withRegistry(dockerRegistry) {*/ imageObject.push() /* }*/ } } } stage('Cleanup') { steps { sh 'echo "TODO: cleanup!"' } } } }