podTemplate( containers: [ containerTemplate( name: 'gradle', image: 'gradle:jdk11', command: 'cat', ttyEnabled: true ) ], volumes: [ hostPathVolume( mountPath: '/home/gradle/.gradle', hostPath: '/tmp/jenkins/.gradle' ), ] ) { node(POD_LABEL) { stage('Build') { container('gradle') { sh "gradle build" } } } } }