这是indexloc提供的服务,不要输入任何密码
Skip to content

Should not change ownership of files mounted from host #1879

@Maetveis

Description

@Maetveis

What happened?

With the docker provider on linux, using podman (DOCKER_PATH=podman) given a workspace mounted from a local folder with a devcontainer.json that contains:

{
  "updateRemoteUserUID": false,
}

then devpod up will change the file ownership of the local files to the uid of the remote user in the container. This makes the files inaccessible on the host.

What did you expect to happen instead?

Workspace file ownership is not modified if they are mounted from the host. If they are mounted as a docker volume or cloned within the image modifying them would be fine.

How can we reproduce the bug? (as minimally and precisely as possible)

devpod up <path-to-local-workspace>

On the host

> ls -la <path-to-local-workspace>
ls: cannot open directory '<path-to-local-workspace>': Permission denied
> ls -la $(realpath <path-to-local-workspace>/..)
...
drwxr-x---  5   101000  101000 4096 Jun 12 17:37 <workspace-folder>

My devcontainer.json:

{
  "image": "mcr.microsoft.com/devcontainers/base:ubuntu-24.04",
  "updateRemoteUserUID": true,
  "containerUser": "vscode"
}

Local Environment:

  • DevPod Version: v0.6.15
  • Operating System: linux
  • ARCH of the OS: AMD64

DevPod Provider:

  • Local/remote provider: docker

Anything else we need to know?

The permissions once modified by devpod then can only be fixed with podman unshare chown -R 0:0 <path-to-local-workspace> or by the root user. Disovering the podman unshare option is not easy, the user could easily believe their files are unrecoverable if they lack sudo access on the host.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions