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

Dev Containers mounts files as root instead of my user #237125

Open
qidydl opened this issue Dec 31, 2024 · 1 comment
Open

Dev Containers mounts files as root instead of my user #237125

qidydl opened this issue Dec 31, 2024 · 1 comment
Assignees

Comments

@qidydl
Copy link

qidydl commented Dec 31, 2024

Type: Bug

I installed Docker Community Edition and followed the official Docker documentation for running in rootless mode (https://docs.docker.com/engine/security/rootless/). I then attempted to add a devcontainer to my repository. Everything works, except all of the files inside the container (under /workspaces) appear to be mounted and owned as root, which means unless I set remoteUser to root, I cannot make any changes. How can I get VSCode/devcontainers to mount the files as the same vscode user that it uses inside the container? Setting the containerUser property did not work.

VS Code version: Code 1.96.2 (fabdb6a, 2024-12-19T10:22:47.216Z)
OS version: Linux x64 6.11.0-13-generic snap
Modes:

System Info
Item Value
CPUs AMD Ryzen 7 2700X Eight-Core Processor (16 x 4141)
GPU Status 2d_canvas: unavailable_software
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: disabled_software
multiple_raster_threads: enabled_on
opengl: disabled_off
rasterization: disabled_software
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: disabled_software
video_encode: disabled_software
vulkan: disabled_off
webgl: unavailable_software
webgl2: unavailable_software
webgpu: disabled_off
webnn: unavailable_software
Load (avg) 1, 1, 1
Memory (System) 15.46GB (10.88GB free)
Process Argv --no-sandbox --force-user-env --crash-reporter-id bb1c73ce-4ea6-46ad-8106-89003d24d57a
Screen Reader no
VM 0%
DESKTOP_SESSION plasma
XDG_CURRENT_DESKTOP KDE
XDG_SESSION_DESKTOP KDE
XDG_SESSION_TYPE wayland
Extensions (16)
Extension Author (truncated) Version
language-hugo-vscode bud 1.3.1
githistory don 0.6.20
xml Dot 2.5.1
codespaces Git 1.17.3
gc-excelviewer Gra 4.2.62
vscode-docker ms- 1.29.3
debugpy ms- 2024.14.0
isort ms- 2023.10.1
python ms- 2024.22.1
vscode-pylance ms- 2024.12.1
remote-containers ms- 0.394.0
hexeditor ms- 1.11.1
wasm-wasi-core ms- 1.0.2
vscode-yaml red 1.15.0
code-spell-checker str 4.0.21
vscode-icons vsc 12.10.0
A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805cf:30301675
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
vscrp:30673768
2i9eh265:30646982
962ge761:30959799
pythonnoceb:30805159
pythonmypyd1:30879173
h48ei257:31000450
pythontbext0:30879054
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
dvdeprecation:31068756
dwnewjupyter:31046869
nativerepl2:31139839
pythonrstrctxt:31112756
nativeloc2:31192216
cf971741:31144450
iacca1:31171482
notype1:31157159
5fd0e150:31155592
dwcopilot:31170013
stablechunks:31184530
6074i472:31201624

@qidydl
Copy link
Author

qidydl commented Dec 31, 2024

The repository I am working out of: https://github.com/qidydl/wadny

Note how I have to specify "remoteUser": "root" in devcontainer.json because all the files inside the container get mounted as root. I want to change how /workspaces is mounted so I don't have to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants