devcontainer: run as non-root user to fix file ownership#3096
Merged
Conversation
bfdcf04 to
b85ef2d
Compare
Switch remoteUser from root to vscode so files created inside the container are owned by the host user instead of root. Use postStartCommand to chmod the docker socket and fix ~/.docker ownership on every container start.
0a1211c to
8bae8dc
Compare
juan-malbeclabs
approved these changes
Feb 24, 2026
Contributor
juan-malbeclabs
left a comment
There was a problem hiding this comment.
LGTM. Very grateful!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
remoteUserfromroottovscodeso files created inside the container are owned by the host user instead of root, fixing permission issues on Windows/WSLupdateRemoteUserUIDto remap container UID to match the host userpostStartCommandto chmod the docker socket and fix~/.dockerownership on every container starttarget/directory inpostCreateCommandTesting Verification
docker psworks without sudo from VS Code terminalvscodeuser