they may not take advantage of on-disk caches between subsequent Pipeline runs. Pipeline supports adding custom arguments which are passed to Docker, allowing users to specify custom Docker Volumes to mount, which can be used for caching data on the agent between Pipeline runs. The following example will cache  ~/.m2  between Pipeline runs utilizing the  maven container, thereby avoiding the need to re-download dependencies for subsequent runs of the Pipeline. // Declarative // pipeline { agent { docker { image 'maven:3-alpine' args '-v $HOME/.m2:/root/.m2' } } stages { stage('Build') { steps { sh 'mvn -B' } } } } // Script // node { /* Requires the Docker Pipeline plugin to be installed */ docker.image('maven:3-alpine').inside('-v $HOME/.m2:/root/.m2') { stage('Build') { sh 'mvn -B' } } } Using multiple containers It has become increasingly common for code bases to rely on multiple, different, technologies. For example, a repository might have both a Java-based back-end API implementation  and  a JavaScript- based front-end implementation. Combining Docker and Pipeline allows a  Jenkinsfile  to use multiple  types of technologies by combining the  agent {}  directive, with different stages. 51