microsoft / vscode-remote-release

Visual Studio Code Remote Development: Open any folder in WSL, in a Docker container, or on a remote machine using SSH and take advantage of VS Code's full feature set.
https://aka.ms/vscode-remote
Other
3.62k stars 276 forks source link

Add ability to mount volumes by configuration #3185

Open paulriley opened 4 years ago

paulriley commented 4 years ago

In a similar vein to being able to install extensions that are good for me, but not essential to my project, and configure a dotfiles repo to install tools that are useful to me but not essential for my project, it would be helpful if I could bind volumes that are useful to me but not essential for my project.

Example use-case: I like to use oh-my-zsh for terminal hacking, but I don't want to force other people working on my project to work with zsh when bash would do the job. Currently, I install zsh, oh-my-zsh and all my favourite themes/plugins in dotfiles. If I could share zsh history across my various containers through a named volume on the host then the oh-my-zsh auto-complete plugin would become a lot more useful.

Unfortunately, at least as I understand it, mounts can be added only through docker run, which is entirely under the control of the remote containers extension. I could add it to the mounts property and it wouldn't really hurt anyone else, but that feels like a bad solution for personal preferences. It also doesn't help me when I work on someone else's project.

If a user-level config array was added (similar to the extensions list) that accepted strings in the same format as the mounts property in devcontainer.json then merged the two lists (removing any effective dupes) before passing them to docker run, I could solve that problem (and others) pretty easily.

chrmarti commented 2 years ago

Related: #5207.