Answers: <p>Single quotes in shell meant to leave the enclosed string 'as is'. That is the variable inside single quotes isn't going to be evaluated. Try changing <code>'${WORKSPACE}'</code> for <code>&quot;${WORKSPACE}&quot;</code>.</p>
  
Answers: CC BY-SA 4.0
Answers: 2020-11-25T20:11:06.750Z
Answers: I tried all the options, it didn't help
Answers: arielma
Answers: CC BY-SA 4.0
Answers: 2020-11-25T19:43:18.527Z
Answers: 2020-11-25T19:43:18.527Z
Answers: anemyte
Body: <p>I have the below command in my <code>Jenkinsfile</code>:</p>
  <pre><code>docker run --rm -v &quot;${WORKSPACE}&quot;:/var/cache/de --entrypoint=/usr/local/bin/pytest ${IMAGE_NAME}:${IMAGE_VERSION} -m &quot;not require_dss&quot; -s -v --cov-report term --cov=app_dss_bundle --junitxml=/var/cache/de/rtest.xml tests
  
  ls -l
  </code></pre>
  <p>I'm running inside docker slave, so it means its docker inside docker. I can't see the <code>rtest.xml</code> in the <code>WORKSPACE</code> afterward (it works for me in my private linux docker env). I already tried to run the suggestion of <code>-v /var/run/docker.sock:/var/run/docker.sock</code> but it didn't help. any other idea?</p>
  
Comments: CC BY-SA 4.0
Comments: 2020-11-26T19:12:35.180Z
Comments: Any other suggestion?
Comments: arielma
Tags: <docker><jenkinsfile><volume>
Title: Docker in docker volume mount doesn't work
UserDisplayName: arielma
ThreadText: # Docker in docker volume mount doesn't work
  
  (Asked by: username_0 on 2020-11-25)
  
  I have the below command in my `Jenkinsfile`:
  
  ```
  docker run --rm -v "${WORKSPACE}":/var/cache/de --entrypoint=/usr/local/bin/pytest ${IMAGE_NAME}:${IMAGE_VERSION} -m "not require_dss" -s -v --cov-report term --cov=app_dss_bundle --junitxml=/var/cache/de/rtest.xml tests
  
  ls -l
  
  ```
  
  I'm running inside docker slave, so it means its docker inside docker. I can't see the `rtest.xml` in the `WORKSPACE` afterward (it works for me in my private linux docker env). I already tried to run the suggestion of `-v /var/run/docker.sock:/var/run/docker.sock` but it didn't help. any other idea?
  
  **Tags:** docker, jenkinsfile, volume
  
  > **Comments:**
  > **username_0**: Any other suggestion?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-11-25. Score: 2 | Accepted answer
  
  Single quotes in shell meant to leave the enclosed string 'as is'. That is the variable inside single quotes isn't going to be evaluated. Try changing `'${WORKSPACE}'` for `"${WORKSPACE}"`.
  
  > **Comments:**
  > **username_0**: I tried all the options, it didn't help  
  
  ---
  
  