container r/w bindmount volume as host user?

I’d like my syncthing container to read/write its bind mount volume as if it were the host’s primary user (1000:1000). Same with the syncthing config directory.

I think the container Readme might address this, but I’m unable to get it to work. Instead syncthing’s writes appear to the host as 100999:100999.

I have success using Podman’s --userns=keep-id. I’m looking for a non-Podman-specific docker cli equivalent. Here’s the full working command:

docker run --network=host -e STGUIADDRESS= \ -v /home/me/Documents/syncthing_container/test_environment:/var/syncthing \ --hostname=syncthing_container_test \ --userns=keep-id \ syncthing/syncthing:latest

What’s the generic docker cli equivalent? (Running on a Linux host btw)

TIA

As far as I know, the Docker default is to not remap user IDs. I haven’t had to do anything specific in my Docker or Kubernetes setups to avoid the issue you see.

Thanks. You inspired me to also try Docker. The syncthing container successfully writes as my host’s primary user (1000:1000) by default. My takeaway was that the 100999:100999 mapping problem was related to Podman.

Then I found this --userns=mode — Podman documentation . By default Podman maps the host user with the container’s root:root. Because the syncthing container runs as 1000:1000, with Podman I need to map my host user 1000 with the container’s user 1000 via --userns=keepid (or the more explicit --userns=keep-id:uid=1000,gid=1000).