def dockerFile = """ FROM alpine:latest MAINTAINER TheSpider RUN \\ apk add --no-cache icecast && \\ mkdir /icecast USER icecast WORKDIR /icecast """ podTemplate( containers: [ containerTemplate( name: "docker", image: "docker:19.03", command: "sleep", args: "99d", envVars: [ envVar( key: "DOCKER_HOST", value: "tcp://localhost:2375" ) ] ), containerTemplate( name: "docker-daemon", image: "docker:19.03-dind", command: "dockerd-entrypoint.sh", args: "--insecure-registry registry.test-chamber-13.lan:5000", privileged: true, envVars: [ envVar( key: "DOCKER_TLS_CERTDIR", value: "" ) ], ) ] ) { node(POD_LABEL) { container("docker") { stage("Write Dockerfile"){ writeFile(file: "Dockerfile", text: dockerFile) } stage("Build Container"){ dockerImage = docker.build("thespider/icecast") } stage('Push image') { docker.withRegistry('https://registry.hub.docker.com', 'docker-hub-credentials') { dockerImage.push("latest") } } } } }