title: Jenkins store workspace outside docker container
body: <p>So I have a Jenkins Master-Slave setup, where the master spins up a docker container (on the slave VM) and builds the job inside that container then it destroys the container after it's done. This is all done via the Jenkins' Docker <a href="https://wiki.jenkins-ci.org/display/JENKINS/Docker+Plugin" rel="nofollow noreferrer">plugin</a>.</p>
  
  <p>Everything is running smoothly, however the only problem is that, after the job is done (failed job) I cannot view the workspace (because the container is gone). I get the following error:</p>
  
  <p><a href="https://i.stack.imgur.com/zjpv0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zjpv0.png" alt="No Workspace Error"></a></p>
  
  <p>I've tried attaching a "volume" from the host (slave VM) to the container to store the files outside also (which works because, as shown below, I can see files on the host) and then tried mapping it to the master VM:</p>
  
  <p><a href="https://i.stack.imgur.com/QLuFz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QLuFz.png" alt="Host files"></a></p>
  
  <p>Here's my settings for that particular docker image template:</p>
  
  <p><a href="https://i.stack.imgur.com/S9gXZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/S9gXZ.png" alt="Docker template"></a></p>
  
  <p>Any help is greatly appreciated!</p>
  
  <p>EDIT: I've managed to successfully get the workspace to store on the host.. However, when the build is done I still get the same error (Error: no workspace). I have no idea how to make Jenkins look for the files that are on the host rather than the container.</p>