pipeline { agent { kubernetes { yaml ''' apiVersion: "v1" kind: "Pod" metadata: spec: containers: - command: - "cat" image: "docker:dind" name: "dind" tty: true volumeMounts: - mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false ''' retries 2 } } stages { stage('Docker test') { steps { container('dind') { sh 'docker --version' } } } stage('git test') { steps { sh 'git --version' } } } }