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

does lsp support mapping multiple source dirs to multiple destinations #92

Open
korenhe opened this issue Jun 7, 2024 · 4 comments
Open

Comments

@korenhe
Copy link

korenhe commented Jun 7, 2024

by using .lsp-docker.yaml,
it is good for mapping only one source to one destinations like this :

  mappings:
    - source: "~/A"
      destination: "A-in-docker"

myquestion is, is it possible to map multiple dirs, such as:

  mappings:
    - source: "~/A"
       destination: "A-in-docker"
    - source: "~/B"
      destination: "B-in-docker" 

my simple test result failed to start the docker container error, though i can copy B into A so I can mount one folder, but i think mount multiple folders may be easier to use.

@factyy
Copy link
Collaborator

factyy commented Jun 11, 2024

Right now it is not possible to map multiple source dirs.

Can be implemented as an additional feature though. I'll take a look when I have enough time

@factyy
Copy link
Collaborator

factyy commented Jun 24, 2024

@korenhe , just rechecked the feature: it looks like it is already implemented.

Are both of your source dirs inside a single project root (current implementation allows you to map only project root child folders)?

@korenhe
Copy link
Author

korenhe commented Jun 24, 2024

@factyy , my use case is in the host, the two folders are not in one root project, I need the mapping volumes to map those two folders to one root project in the docker.
If the host folders are already in same root project, It seems not necessary to map the subfolders, right? since they are already there.

@factyy
Copy link
Collaborator

factyy commented Jun 25, 2024

@korenhe , the idea behind these limitations is simple: to avoid security risks (e.g. you are running "rootful" Docker with a root user inside the container) and accidentally map a sensitive root-owned directory on the host (e.g. /etc) into the container. Than you can modify this directory from inside the container.

So right now any mapping is checked against the project root. You may not map the project root dir itself but a few separate folders down the directory tree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants