title: Trying to mount a host volume on a Docker container on Windows. What is the source folder relative to?
body: <p>I'm having trouble on trying to mount a volume to my docker container.</p>
  <p>Here is my project structure</p>
  <pre><code>cloudRun
    distService/
      index.js
    Dockerfile
    package.json    // THIS IS THE package.json FOR THE DOCKER IMAGE
  
  package.json      // THIS IS MY MAIN PROJECT package.json
  </code></pre>
  <p>In my main project <code>package.json</code> I have the following scripts:</p>
  <pre><code>&quot;docker-run&quot;: &quot;./scripts/docker/docker-run.sh&quot;,
  &quot;docker-inspect&quot;: &quot;docker exec -ti hello-world sh&quot;   // THIS IS USED TO INSPECT THE RUNNING CONTAINER
  </code></pre>
  <p><strong>docker-run.sh</strong></p>
  <pre><code>// STOPS ALL CONTAINERS
  // REMOVES ALL CONTAINERS
  // REMOVES ALL IMAGES
  
  // BUILDS A NEW IMAGE FROM SCRATCH
  docker build --tag hello-world:latest ./cloudRun
  
  // TRYING TO RUN THE CONTAINER WITH A MOUNTED /distService VOLUME
  docker run --name hello-world -p 3000:3000 -v //distService:/distService hello-world:latest
  </code></pre>
  <p>This is the <code>Dockerfile</code>:</p>
  <pre><code>FROM node:12-slim
  
  WORKDIR /
  
  COPY ./package.json ./package.json
  
  RUN npm install
  
  ENTRYPOINT npm start
  </code></pre>
  <p>It's all working. Except for the fact that the container is seeing <code>/distService</code> as an empty folder.</p>
  <p>I know this because when I open a new terminal window and run:</p>
  <pre><code>npm run docker-inspect
  </code></pre>
  <p>I get to enter the folders and <code>ls</code> them. And this is what I'm getting: there is a <code>distService</code> folder, but the <code>ls</code> command comes back empty. PS: I did a <code>ls</code> on <code>node_modules</code> just to show that it works and the <code>distService</code> is indeed empty.</p>
  <p><a href="https://i.stack.imgur.com/qSmCB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qSmCB.png" alt="enter image description here" /></a></p>
  <p><strong>QUESTION</strong></p>
  <p>When I pass <code>-v //folder:/folder</code>, what is the source folder relative to? How can I be sure that I'm picking the right folder?</p>
  <p><strong>Environment:</strong></p>
  <pre><code>Windows 10.
  Docker for Windows installed
  Docker Engine v19.03.13
  </code></pre>
  <p><strong>UPDATE</strong></p>
  <p>I ran the container and inspected it with: <code>docker inspect &lt;CONTAINER_ID&gt;</code> to see what folder is being mounted. But it didn't help much. This is what came back:</p>
  <pre><code>&quot;HostConfig&quot;: {
    &quot;Binds&quot;: [
      &quot;//distService/:/distService/&quot;
  ],
  
  // OTHER STUFF
  
  &quot;Mounts&quot;: [
    {
      &quot;Type&quot;: &quot;bind&quot;,
      &quot;Source&quot;: &quot;/distService&quot;,         // WHAT IS THIS PATH RELATIVE TO ?
      &quot;Destination&quot;: &quot;/distService&quot;,
      &quot;Mode&quot;: &quot;&quot;,
      &quot;RW&quot;: true,
      &quot;Propagation&quot;: &quot;rprivate&quot;
    }
  ],
  </code></pre>