-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Clarifications on limitations of mounting .vscode-server, WSL tip clarification #2988
Conversation
|
||
Replace `your-volume-name-goes-here` with a unique volume name for the container in `devcontainer.json` as follows: | ||
1. **If you are using a non-root user**, you'll need to ensure your Dockerfile creates `~/.vscode-server` and/or `~/.vscode-server-insiders` in the container. If you do not do this, the folder will be owned by root and your connection will fail with a permissions issue. See [Adding a non-root user to your dev container](#adding-a-non-root-user-to-your-dev-container) for full details, but you can use this snippet in your Dockerfile to create the folders for a `vscode` user: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe refer to "the non-root user" instead of "a vscode
user", otherwise users might think that naming a user vscode
makes it somehow special?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I just noticed a typo in the later section - I changed this to user-name-goes-here
for exactly the reason you mention, but didn't do it everywhere. Will submit a PR for that correction.
``` | ||
```Dockerfile | ||
ARG USERNAME=vscode | ||
RUN mkdir -p /home/$USERNAME/.vscode-server /home/$USERNAME/.vscode-server-insiders \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would:
USER someuser
RUN mkdir -p ~/.vscode-server ...
work and make it easier to apply?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would cause the commands that follow to run as the user specified. If you've opted not to install sudo
for security reasons, switching to the other user would be the last step. This is also a partial of the full code that creates the user in that section
"runArgs": [ | ||
"-v", "unique-vol-name-here:/root/.vscode-server", | ||
// And/or for VS Code Insiders | ||
"-v", "unique-vol-name-here-insiders:/.vscode-server-insiders", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be easier to only show the code for stable and add a note in the text that the same applies for the insiders folder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had it that way, but then you need to say "also insiders" in each spot where this is needed, which actually ended up taking up more space and was easy to miss. This was a bit more concise and allows you to use both versions - cut and paste also covers both use cases so people don't have to think as much.
Partial resolution to microsoft/vscode-remote-release#1153
Also drops mention of adding Windows system path into WSL path in the troubleshooting article as this is no longer required.