devcontainers / cli

A reference implementation for the specification that can create and configure a dev container from a devcontainer.json.
https://containers.dev
MIT License
1.55k stars 219 forks source link

`updateRemoteUserUID` has no effect #874

Open cadojo opened 2 months ago

cadojo commented 2 months ago

When using this CLI, the container or remote user's UID and GID are not updated. This issue is documented in https://github.com/microsoft/vscode-remote-release/issues/10030, but I think the core issue might be located here. I have an example repository up on GitHub. Steps to reproduce are below. Am I missing something in my configuration, or is this a bug?

git clone https://github.com/cadojo/devcontainer-uid-example
id
cd devcontainer-uid-example
devcontainer up --workspace-folder . --remove-existing-container --build-no-cache
devcontainer exec --workspace-folder . id

I see the following text on containers.dev... does this mean that on MacOS, or Windows, there is no way to sync the container user's UID and GID with the local user's?

On Linux, if containerUser or remoteUser is specified, the user’s UID/GID will be updated to match the local user’s UID/GID to avoid permission problems with bind mounts. Defaults to true.

chrmarti commented 2 months ago

This only applies on Linux. Windows doesn't have Unix-like UIDs/GIDs. On macOS you would get the UID/GID mapped by Docker Desktop, maybe you are using something else?