Docker Community Forums

Share and learn in the Docker community.

Dperson/samba - ownership of files set to systemd-network & systemd-journal

So, with the help of the nice people here, I managed to get samba running and to connect to a share from Finder on a Mac :slight_smile:

I though it was all ok working OK, but apparently I’m still having some trouble…

Running on a NUC with Ubuntu. Here is my docker-compose.yml contents:

version: '3.4'

    container_name: samba
    image: dperson/samba:latest
      TZ: 'Europe/Brussels'
      - default
      - "137:137/udp"
      - "138:138/udp"
      - "139:139/tcp"
      - "445:445/tcp"
    read_only: true
      - /tmp
    restart: unless-stopped
    stdin_open: true
    tty: true
      - $HOME/docker:/dockerdata:z
    command: '-n -p -s "Docker;/dockerdata;yes;no;no;jdoe" -u "jdoe;somepassword"'


The user jdoe is also the user I use to SSH into the NUC with Terminal on my Macbook.

The goal is to share the $HOME/dockerdirectory and all its contents for easy editing from my Macbook with Visual Studio Code.

When I start up the Samba container, ownership of the entire $HOME/docker tree gets changed to systemd-network:systemd-journal. When I connect to the share from my Macbook, I can edit all the files in that share.
However, some other containers such as Pihole fail to (re-)start… Probably due to that change in ownership.
Also, I cannot write to the files (E.g. with nano) when I am logged in the NUC shell with SSH.

I can of course revert all the ownerships to the original ones with
sudo chown jdoe:jdoe $HOME/docker -R
and then the files are again writable by user “jdoe” in the NUC shell, but not anymore by a Samba user from the Macbook…
What al I missing here?