Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Option to ignore certain folder #620

Open
DanielHabenicht opened this issue Jun 9, 2019 · 2 comments
Open

Add Option to ignore certain folder #620

DanielHabenicht opened this issue Jun 9, 2019 · 2 comments
Labels
containers Issue in vscode-remote containers feature-request Request for new features or functionality

Comments

@DanielHabenicht
Copy link

Proposed Feature

It would be great to ignore certain folders from being mounted to the container, by adding an option like this:

// devcontainer.json
"workspaceFolderIgnore": [
    "path/to/folder/node_modules"
]

Reasons

  1. A Dev-Dockerfile with the RUN npm install command specified creates a node_modules folder which might be OS-specific (for example if node-sass gets installed). This folder gets overridden by the folder mount done by the vs-code-remote plugin. That causes consecutive steps (like npm run start) to fail.

    By ignoring this folder from mounting the images node_modules folder gets preserved and everything works as expected.

  2. Other tools might also create such folders (e.g. golang).

  3. A user not familiar with docker wants to ignore specific files.

Current Workaround

(From #560 (comment))

"runArgs": [
  "--mount",
    "type=volume,target=/workspace/node_modules"
  ],
  "workspaceFolder": "/workspace",
@egamma egamma added the feature-request Request for new features or functionality label Jun 12, 2019
@chrmarti chrmarti added the containers Issue in vscode-remote containers label Nov 6, 2020
@bjoernhommel
Copy link

Any progress on this?

@jlarmstrongiv
Copy link

jlarmstrongiv commented Apr 2, 2022

The workaround works just fine, but I updated it to:

    mounts: [
      "type=volume,target=${containerWorkspaceFolder}/node_modules",
    ],

Also, npm ci no longer deletes the node_modules folder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
containers Issue in vscode-remote containers feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

5 participants