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

Allow usage of named volumes inside dev containers #177

Closed
matevarga opened this issue May 6, 2019 · 3 comments
Closed

Allow usage of named volumes inside dev containers #177

matevarga opened this issue May 6, 2019 · 3 comments
Labels
containers Issue in vscode-remote containers *question Issue represents a question, should be posted to StackOverflow (VS Code)

Comments

@matevarga
Copy link

Use case:
Alice is using VS Code under Windows. She has a large project that takes a while to check out / build, also she tends to have unpushed branches locally. She wants to use VSC remote-containers to benefit from the standardized environment.
According to the current docs/suggestions, Alice would use Docker for Windows and check out the code on Windows. However, this means that code would be shared with the container through SMB, which means lots of lost performance and various other issues (like Maven war-plugin crapping out due some stat commands failing during builds, etc.).

Solution: Alice clones the repo inside the container, so she gets the benefit of VSC remote dev: she can use her Windows PC while avoiding problems with compilation, performance. Downside: state is lost during container rebuild.

Feature request: option to easily create a named volume that'd store the container's state between rebuilds.

Thanks.

@matevarga
Copy link
Author

matevarga commented May 6, 2019

For anyone who'd like to do this: it's possible!

First create a named volume like
docker volume create devenv

In your devcontainer.json put

"runArgs": ["-v", "devenv:/workspaces" <,other params>]

This way you can persist /workspaces between container rebuilds.

@kieferrm kieferrm added the containers Issue in vscode-remote containers label May 6, 2019
@egamma egamma added the feature-request Request for new features or functionality label May 7, 2019
@egamma
Copy link
Member

egamma commented May 7, 2019

//fyi @chrmarti

@chrmarti
Copy link
Contributor

chrmarti commented May 7, 2019

You could also switch to using Docker Compose, there you get to control all aspects of the containers: https://code.visualstudio.com/docs/remote/containers#_using-docker-compose

I'll close this issue as there are already two ways of doing this. Thanks.

@chrmarti chrmarti closed this as completed May 7, 2019
@chrmarti chrmarti added *question Issue represents a question, should be posted to StackOverflow (VS Code) and removed feature-request Request for new features or functionality labels May 7, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Jun 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
containers Issue in vscode-remote containers *question Issue represents a question, should be posted to StackOverflow (VS Code)
Projects
None yet
Development

No branches or pull requests

4 participants