lima-vm / lima-vm/lima

VirtioFS directory mapping wrong uid/gid on Darwin (docker rootful template)

Open
#4,053 25 comments 0 reactions 0 assignees View on GitHub
component/vz kind/external
Dominant language
Go
Stars
21.9k
Forks
957
Avg merge
2d 6h
Merged PRs (30d)
53

Description

### Description

Hi everyone!

I'm experiencing an issue with incorrect UID/GID mapping for an existing directory. When this directory is mapped inside a container, I expect it to be mounted with the `uid:gid` as files, which is the usual behavior on Linux with Docker Desktop.

Here’s what is happening when comparing Lima and Docker Desktop:

```shell
❯ ls -altr
total 0
-rw-r--r--@ 1 paolomainardi staff 0 Sep 18 17:07 test
drwxr-xr-x@ 3 paolomainardi staff 96 Sep 18 17:07 .
drwxr-xr-x@ 105 paolomainardi staff 3360 Sep 18 17:13 ..

❯ docker context use lima-sf-docker-dev
lima-sf-docker-dev
Current context is now "lima-sf-docker-dev"

❯ docker run -u 501 --rm -v $PWD:/test alpine:latest ash -c "ls -altr / | grep test"
drwxr-xr-x 3 root root 96 Sep 18 15:07 test

❯ docker context use desktop-linux
desktop-linux
Current context is now "desktop-linux"

❯ docker run -u 501 --rm -v $PWD:/test alpine:latest ash -c "ls -altr / | grep test"
drwxr-xr-x 3 501 root 96 Sep 18 15:07 test
```

This isn’t a major issue, but it has disrupted several of my scripts, including a command that triggers the error `fatal: detected dubious ownership in repository` when running `git rev-parse --show-toplevel`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.