-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
Hi,
not sure if it is fixable in this repository or should be reported somewhere else. Just wanted to document the issue if others encounter it and reduce their time spent troubleshooting.
Using the devcontainer template with image swift:6.1 on Linux with a host user/group ID of 1000 will enter the devcontainer as user vscode with user/group ID of 1001, resulting in permission issues for any file changes.
vscode ➜ /workspaces/new $ id
uid=1001(vscode) gid=1001(vscode) groups=1001(vscode)
vscode ➜ /workspaces/new $ touch test
touch: cannot touch 'test': Permission denied
There is an existing user ubuntu in the container with the ID 1000.
vscode ➜ /workspaces/new $ getent passwd ubuntu
ubuntu:x:1000:1000:Ubuntu:/home/ubuntu:/bin/bash
Changing the devcontainer.json template to user ubuntu resolves the permission issues.
...
"username": "ubuntu",
...
"remoteUser": "ubuntu"
ubuntu ➜ /workspaces/new $ id
uid=1000(ubuntu) gid=1000(ubuntu) groups=1000(ubuntu),4(adm),20(dialout),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev)
Comparing it with other devcontainer templates the user id for vscode is 1000 and no changes need to be made in the template.
E.g. Go
vscode ➜ /workspaces/container $ id
uid=1000(vscode) gid=1000(vscode) groups=1000(vscode),998(nvm),999(golang)
Metadata
Metadata
Assignees
Labels
No labels