GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Agents
  • Models
  • Customizations
  • Continuity
  • Write code
  • Enterprise
  • Extensibility
  • Release notes
  • Blog
  • Documentation
  • Learn
  • API
  • FAQ
  • Extension Marketplace (opens in new tab)

This view

  • Original page
  • New address

GeezerVison is showing code.visualstudio.com — Add another local file mount

Add another local file mount

Note: Mounting the local file system is not supported in GitHub Codespaces. See developing inside a container on a remote Docker host for information on mounting remote folders in this scenario.

You can add a volume bound to any local folder by using the following appropriate steps, based on what you reference in devcontainer.json:

  • Dockerfile or image: Add the following to the mounts property (VS Code 1.41+) in this same file:

    "mounts": [
      "source=/local/source/path/goes/here,target=/target/path/in/container/goes/here,type=bind,consistency=cached"
    ]
    

    You can also reference local environment variables or the local path of the workspace. For example, this will bind mount ~ ($HOME) on macOS/Linux and the user's folder (%USERPROFILE%) on Windows and a sub-folder in the workspace to a different location:

    "mounts": [
        "source=${localEnv:HOME}${localEnv:USERPROFILE},target=/host-home-folder,type=bind,consistency=cached",
        "source=${localWorkspaceFolder}/app-data,target=/data,type=bind,consistency=cached"
    ]
    

Video: Add additional folders from your local machine to a dev container

Watch How to add a folder from your local file system to a dev container on YouTube (opens in new tab).



  • Docker Compose: Update (or extend) your docker-compose.yml with the following for the appropriate service:

    version: '3'
    services:
      your-service-name-here:
        volumes:
          - /local/source/path/goes/here:/target/path/in/container/goes/here:cached
          - ~:/host-home-folder:cached
          - ./data-subfolder:/data:cached
         # ...
    

If you've already built the container and connected to it, run Dev Containers: Rebuild Container from the Command Palette (F1) to pick up the change. Otherwise run Dev Containers: Open Folder in Container... to connect to the container.

11/11/2026
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.