microsoft / microsoft/vscode-remote-release
Select VSCode Server volume by custom name
@chrmarti is already working on this.
Since Jul 5, 2021.
- Dominant language
- Dockerfile
- Stars
- 4.2k
- Forks
- 470
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 1
Description
Feature Request
Please allow the "Remote - Containers" extension workflow to function for multiple users on the same Docker host by facilitating deconflicting the name of the volume mounted on the dev container into which the plugin installs VSCode server components.
Potential solutions
- Use a GUID/UUID in the volume name.
- Allow the user to customize the name of the volume or volume mount entirely in the same manner as is supported for the workspace volume.
Back Story
When "Developing inside a container on a remote Docker host" such as Mirantis Container Runtime (formerly Docker Engine - Enterprise) using the first variation documented where :
create your remote dev container first, and then clone your source code into a named volume since this does not require you to have direct access to the filesystem on the remote host
...a preexisting, custom-named volume into which code is cloned can be selected using the workspaceMount directive in devcontainer.json:
{ ... "workspaceMount": "source=remote-workspace,target=/workspace,type=volume" }
However, when the container is run, a second volume is mounted named vscode. This is not configurable and if the user doesn't have access to mount an existing volume with that name the container will fail to run. In solutions like Docker EE this scenario may arise when a volume already exists and is part of a Docker EE "Collection" in which the current user is not a member. It seems the named volumes in Docker EE are global so only one person could use this "Developing inside a container on a remote Docker host" capability per Docker EE UCP!!! Alternatively, each person must be granted access to and use the same VSCode server volume. 😬 🙊
Example of failure:
[PID 16260] [9523 ms] Start: Starting container
[PID 16260] [9523 ms] Start: Run: docker run --sig-proxy=false -a STDOUT -a STDERR --mount source=user,target=/workspace,type=volume --mount type=volume,src=vscode,dst=/vscode -l vsch.local.folder=c:\Users\user\wa -l vsch.quality=stable -l vsch.remote.devPort=0 -e NODE_EXTRA_CA_CERTS=/usr/local/share/ca-certificates/my.internal.crt --entrypoint /bin/sh vsc-wa-97082f941e1c26e9edb32bd1423ad8e7 -c echo Container started ; trap "exit 0" 15; while sleep 1 & wait $!; do :; done
[PID 16260]
[PID 16260] docker: Error response from daemon: access denied:
no access to Volume Create/Attach, on collection a98b123d-e8c9-2a1a-a11a-2b43dc456134.
See 'docker run --help'.
[PID 16260] [11775 ms] Start: Run: docker ps -q -a --filter label=vsch.local.folder=c:\Users\user\wa --filter label=vsch.quality=stable
[PID 16260] [13596 ms] Command failed: docker run --sig-proxy=false -a STDOUT -a STDERR --mount source=user,target=/workspace,type=volume --mount type=volume,src=vscode,dst=/vscode -l vsch.local.folder=c:\Users\user\wa -l vsch.quality=stable -l vsch.remote.devPort=0 -e NODE_EXTRA_CA_CERTS=/usr/local/share/ca-certificates/my.internal.crt --entrypoint /bin/sh vsc-wa-97082f941e1c26e9edb32bd1423ad8e7 -c echo Container started ; trap "exit 0" 15; while sleep 2 & wait $!; do :; done
| Component | Version |
|---|---|
| Windows | 10 |
| VSCode | 1.55.2 |
| Remote - Containers extension | 0.166.1 |
| Docker CLI | 20.10.7 |
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.