title: How to use Jenkins Docker plugin to build a maven project inside a container
body: <p>Working on a project which uses maven as the build tool. Now when using Jenkins for deployment, we need to build the project inside a docker container using Docker plugin. My understanding is that the project should be build inside the container and once done it should be deleted. </p>
  
  <p>I am trying to use command similar to : docker.image("imageName").inside{}
  Now how do we make sure that the container is deleted and mount a volume so that the jar created as part of build can be accessed after docker container deletion ?</p>
  
  <p>Can some provide inputs on the above understanding and an example of the above command or any link to refer to ?</p>