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

Opening a DevPod in Docker on Windows mounts the project folders as root despite remoteUser and containerUser settings. #1561

Open
ghorsey opened this issue Jan 14, 2025 · 0 comments
Labels

Comments

@ghorsey
Copy link

ghorsey commented Jan 14, 2025

What happened?
When I specify a remoteUser and containerUser in my devcontainer.json the devpod mounts the project files as root

Once the project loads, when I ls the folder structure is mounted as root

Actual

.rwxrwxrwx 5.6k root 14 Jan 22:09 CODE_OF_CONDUCT.md
.rwxrwxrwx  306 root 14 Jan 22:09 CONTRIBUTING.md
drwxrwxrwx    - root 14 Jan 22:09 documentation
.rwxrwxrwx 1.1k root 14 Jan 22:09 LICENSE
.rwxrwxrwx 8.9k root 14 Jan 22:09 NUGET.md
.rwxrwxrwx 4.2k root 14 Jan 22:09 OpenGraphNet.sln
.rwxrwxrwx 1.0k root 14 Jan 22:09 OpenGraphNet.sln.DotSettings
.rwxrwxrwx  47k root 14 Jan 22:09 package-lock.json
.rwxrwxrwx 1.4k root 14 Jan 22:09 package.json
.rwxrwxrwx  11k root 14 Jan 22:09 README.md
drwxrwxrwx    - root 14 Jan 22:09 src
drwxrwxrwx    - root 14 Jan 22:09 tests

What did you expect to happen instead?
I would expect that the files would be owned by the user specified in my devcontainer.json file:

Expected

.rwxrwxrwx 5.6k vscode14 Jan 22:09 CODE_OF_CONDUCT.md
.rwxrwxrwx  306 vscode14 Jan 22:09 CONTRIBUTING.md
drwxrwxrwx    - vscode14 Jan 22:09 documentation
.rwxrwxrwx 1.1k vscode14 Jan 22:09 LICENSE
.rwxrwxrwx 8.9k vscode14 Jan 22:09 NUGET.md
.rwxrwxrwx 4.2k vscode14 Jan 22:09 OpenGraphNet.sln
.rwxrwxrwx 1.0k vscode14 Jan 22:09 OpenGraphNet.sln.DotSettings
.rwxrwxrwx  47k vscode14 Jan 22:09 package-lock.json
.rwxrwxrwx 1.4k vscode14 Jan 22:09 package.json
.rwxrwxrwx  11k vscode14 Jan 22:09 README.md
drwxrwxrwx    - vscode 14 Jan 22:09 src
drwxrwxrwx    - vscode 14 Jan 22:09 tests

How can we reproduce the bug? (as minimally and precisely as possible)
You can use my public project on GitHub as an example: https://github.com/ghorsey/OpenGraph-Net

My devcontainer.json:

{
	"name": "OpenGraph.Net",
	"image": "mcr.microsoft.com/devcontainers/dotnet:1-6.0-jammy",
	"postCreateCommand": "dotnet restore",
	"customizations": {
		"vscode": {
			"extensions": [
				"ms-dotnettools.csdevkit",
				"ms-dotnettools.csharp",
				"aaron-bond.better-comments",
				"ms-vscode-remote.remote-containers",
				"asvetliakov.vscode-neovim",
				"streetsidesoftware.code-spell-checker",
				"EditorConfig.EditorConfig",
				"VisualStudioExptTeam.vscodeintellicode",
				"VisualStudioExptTeam.intellicode-api-usage-examples",
				"ms-dotnettools.vscodeintellicode-csharp",
				"DavidAnson.vscode-markdownlint"
			]
		}
	},	
	"remoteUser": "vscode",
	"containerUser": "vscode"
}

Local Environment:

  • DevPod Version: v0.6.9
  • Operating System: windows
  • ARCH of the OS: AMD64

DevPod Provider:

  • Local/remote provider: docker

Anything else we need to know?

If I directly open the devcontainer (not utilizing DevPod) in WSL the folders mount correctly:

-rw-r--r-- 1 vscode vscode  5489 Jan 14 22:27 CODE_OF_CONDUCT.md
-rw-r--r-- 1 vscode vscode   300 Jan 14 22:27 CONTRIBUTING.md
drwxr-xr-x 5 vscode vscode  4096 Jan 14 22:27 documentation
-rw-r--r-- 1 vscode vscode  1093 Jan 14 22:27 LICENSE
-rw-r--r-- 1 vscode vscode  8686 Jan 14 22:27 NUGET.md
-rw-r--r-- 1 vscode vscode  4156 Jan 14 22:27 OpenGraphNet.sln
-rw-r--r-- 1 vscode vscode  1029 Jan 14 22:27 OpenGraphNet.sln.DotSettings
-rw-r--r-- 1 vscode vscode  1350 Jan 14 22:27 package.json
-rw-r--r-- 1 vscode vscode 45756 Jan 14 22:27 package-lock.json
-rw-r--r-- 1 vscode vscode 10591 Jan 14 22:27 README.md
drwxr-xr-x 3 vscode vscode  4096 Jan 14 22:27 src
drwxr-xr-x 3 vscode vscode  4096 Jan 14 22:27 tests

If I directly open the devcontainer (not utilizing DevPod) in Windows/Powershell the folders mount correctly:

-rw-r--r-- 1 vscode vscode  5489 Nov 20  2023 CODE_OF_CONDUCT.md
-rw-r--r-- 1 vscode vscode   300 Nov 20  2023 CONTRIBUTING.md
drwxrwxrwx 1 vscode vscode  4096 Nov 20  2023 documentation
-rw-r--r-- 1 vscode vscode  1093 Nov 20  2023 LICENSE
-rw-r--r-- 1 vscode vscode  8686 Nov 20  2023 NUGET.md
-rw-r--r-- 1 vscode vscode  4156 Nov 20  2023 OpenGraphNet.sln
-rw-r--r-- 1 vscode vscode  1029 Nov 20  2023 OpenGraphNet.sln.DotSettings
-rw-r--r-- 1 vscode vscode  1350 Nov 20  2023 package.json
-rw-r--r-- 1 vscode vscode 45756 Nov 20  2023 package-lock.json
-rwxrwxrwx 1 vscode vscode 10859 Jan 14 22:31 README.md
drwxrwxrwx 1 vscode vscode  4096 Nov 19  2023 src
drwxrwxrwx 1 vscode vscode  4096 Nov 19  2023 tests

It appears this problem only occurs when opening the DevPod and not when directly opening the dev container in Windows, or WSL2!

@ghorsey ghorsey changed the title Opening a DevPod on Windows mounts the project folders as root despite remoteUser and containerUser settings. Opening a DevPod in Docker on Windows mounts the project folders as root despite remoteUser and containerUser settings. Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant