version="1.0.0" repository="swr.eu-de.otc.t-systems.com" tag="latest" image="swr.eu-de.otc.t-systems.com/omnia-test/${repository}:${version}.${env.BUILD_NUMBER}" namespace="demo" podTemplate(label: 'demo-customer-pod', cloud: 'kubernetes', serviceAccount: 'jenkins', containers: [ containerTemplate( name: 'docker', image: 'docker:dind', ttyEnabled: true, command: 'cat', privileged: true, envVars: [ secretEnvVar(key: "PASS", secretName: "docker-reg", secretKey: "docker-reg") ] ), ], ) { node('test') { stage('Build Docker Image') { container('docker') { sh """ docker login ${env.PASS} swr.eu-de.otc.t-systems.com docker build -t ${image}:${tag} . docker push ${image}:${tag} """ milestone(1) } } } }