title: How to open files in a Docker container outside of container using the Remote Development extension for VSCode
body: <p>Is it possible to open files in a Docker container in my local operating system outside of the container using the <a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack" rel="nofollow noreferrer">Remote Development extension for VSCode</a>
  (such as using right-click 'Open in Explorer' as in the <a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl" rel="nofollow noreferrer">Remote - WSL extension for VSCode</a>)</p>
  <p>I tried to:</p>
  <ul>
  <li>Build Docker Image Without Context</li>
  <li>Mount filesystem Volume
  so that I could access files in my operating system from my container without copying.</li>
  </ul>
  <p>To build without context I can use <code>docker build - &lt; Dockerfile</code> (see <a href="https://docs.docker.com/engine/reference/commandline/build/#build-with--" rel="nofollow noreferrer">docker docs</a>).</p>
  <p>I can mount files via <code>docker run -v &lt;path-to-file-in-host&gt;:&lt;path-to-file-in-container&gt; IMAGE_NAME</code> (as discussed <a href="https://stackoverflow.com/questions/41092587/passing-file-as-argument-to-docker-container">here</a>, and in <a href="https://docs.docker.com/storage/volumes/" rel="nofollow noreferrer">docker docs here</a>)</p>
  <p>From the <a href="https://code.visualstudio.com/docs/remote/devcontainerjson-reference" rel="nofollow noreferrer">devcontainer.json reference</a> it's possible to pass build args to Docker build in your devcontainer.json but this doesn't work for the <code>- &lt;</code> as vscode-dev-containers defaults to including build context...</p>
  <p>The extension also also automatically runs a container after build so I'm not sure how to override this.</p>
  <p>Any tips would be much appreciated!</p>