Skip to content

Specify the ownership of new files created in the mounted volume. #2372

@SnowRipple

Description

@SnowRipple

Hi there,

I checked other posts but I can't find anything that would address this issue so decided to create a new post. My docker knowledge is still very limited so please be understanding.

The ability to load volumes using "-v" is great however limited from my perspective. I would like to be able to specify the owner of new files created inside mounted volumes. Currently, root is owning all new files and that is problematic since the "not sudo" user can't access those files.

I was thinking about something similar to the way sshfs works when you can specify the ownership by using "-o idmap=user" option e.g.

sshfs -o idmap=user [email protected]:/home/directory ~/remote_repo

Now e.g. if I will create "foo" file in "remote_repo" and check its ownership on host's home/directory the owner will be "exampleUser".

When I would mount it using docker volumes the owner of "foo" file would be root which is problematic for non-sudo users.

Btw, are you planning to introduce network addressable volumes (as above in the sshfs example) in the near future?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions