Volume's folders owner get changed after deployment

Due to an issue, I have reinstalled the OS (Ubuntu 22.04.2 LTS), Docker and docker-compose as well.
Then, I have copied the last version of my dockerfile and started docker-compose. It went well, and all the containers recreated but, I have noticed that the owner of the Volume’s folders got changes as below:

root@docker-01:/home/folder/docker/volumes# ls -alh
total 84K
drwxrwxr-x 21 _apt systemd-journal 4.0K Jun 3 13:07 .
drwxrwxr-x 3 _apt systemd-journal 4.0K Jun 3 13:02 …
drwxrwxr-x 4 _apt systemd-journal 4.0K Jun 3 13:03 adguardhome
drwxrwxr-x 6 _apt systemd-journal 4.0K Jun 3 13:03 jdownloader

drwxrwxr-x 3 _apt systemd-journal 4.0K Jun 3 13:03 traefik
drwxrwxr-x 4 _apt systemd-journal 4.0K Jun 3 13:03 uptime-kuma_data

This caused some Container (e.g. homer, etc.) to missing write access to their folder, so the containers (despite running) is stuck. Docker itself is running as “root”:

root@docker-01:/home/folder/docker/volumes# ps aux | grep docker
root 664 4.7 3.7 2418872 75564 ? Ssl 11:51 4:02 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
root 33684 0.0 0.1 1156008 3368 ? Sl 13:03 0:00 /usr/bin/docker-proxy -proto tcp -host-ip -

root 50347 0.0 0.1 4020 2064 pts/1 S+ 13:16 0:00 grep --color=auto docker

I am mot sure where from those owners are coming from.
Does anyone has a clue?


After moving the Volumes under /root/docker the issue is fixed and all the container has started.
However, I am not sure about the root cause…

I spoke too early :sob:
After making some modifications to the YAML file and redeployed by docker-compose, the same issue occurred also for the Volumes on “/root/docker/volumes”. At this point I think I have found the root cause with a specific container (as there is only one mounting “/root” and “/home” at the same time) and it should the one using the image"dperson/samba" for some reasons.
I am assuming “_apt” “systemd-journal” are the services running inside and for some reasons those were applied to the folders getting mounted. I will look a different container