microsoft / microsoft/vscode-remote-release
Rootless docker mounts have the wrong permissions
@chrmarti is already working on this.
Since Mar 12, 2021.
- Dominant language
- Dockerfile
- Stars
- 4.2k
- Forks
- 470
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 1
Description
As of Docker CE 20.10.0 (2020-12-08), support for docker to run rootless has moved out of experimental status and into mainline. While remote containers work, the namespace remapping means that any mounted directories end up with the root uid (uid 0), and so any container user (eg, via containerUser or remoteUser) lacks the permissions to modify these files/directories.
- VSCode Version: 1.54.1
- Local OS Version: Ubuntu 20.04
- Remote OS Version: Any
- Remote Extension/Connection Type: Docker rootless
Steps to Reproduce:
- Install docker as normal. Do not do the normal post-install steps (eg, adding a
dockergroup and adding the user). - Set up docker as rootless
- Create a devcontainer -
Ctrl+Shift+P->Remote Containers: Add Development Container Configuration Files->Alpine - Start container -
Ctrl+Shift+P->Remote Containers: Rebuild and Reopen in Container - Attempt to add a file to the mapped source directory. Get permissions error.
Strictly speaking, this is probably more a docker configuration issue. Unfortunately docker doesn't seem to have an equivalent to podman's --userns=keep-id (as is mentioned in some of the issues on here). Although my current project allows me to use a workaround of running as the container root, this isn't possible for everything (and does mean that some aspects of the development environment would no longer match any deployment environment).
Does this issue occur when you try this locally?: No
Does this issue occur when you try this locally and all extensions are disabled?: No
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.