cdzombak/samba-docker

By cdzombak

Updated 9 months ago

Up-to-date Samba Docker image optimized for NAS file sharing with full macOS Spotlight support.

Image

77

samba-docker

Up-to-date Samba Docker image optimized for NAS file sharing with full macOS Spotlight support via Elasticsearch integration.

Configuration & Usage

TK

Using testparm

With your docker-compose.yml set up, you can use testparm as follows to check your smb.conf:

docker compose run samba testparm /usr/local/samba/etc/smb.conf
IO and Nice Prioritization

Samba is arguably the most important thing running on my NAS; when I'm browsing files/folders on it, I want it to be as fast as possible. To help achieve this I've added the following to the samba service in my docker-compose file:

    command:
      - ionice
      - -c1
      - -n1
      - nice
      - -n-17
      - /usr/local/samba/sbin/smbd
      - --foreground
      - --no-process-group
      - --configfile
      - /usr/local/samba/etc/smb.conf
    cap_add:
      - CAP_SYS_NICE

This runs smbd in the "realtime" IO class, with priority 1 (the possible priorities are 0-7, with lower numbers being higher priority). To give it priority on the CPU, I also give smbd a nice value of -17 (values range down to -19, the highest priority).

Elasticsearch & FSCrawler (for Spotlight support)

TK

also TK: cpu shares for the ES stuff; and (io)nice values for the same.

Monitoring with Netdata

TK

Migrating away from system Samba

TK: necessary if you want samba container to use host networking and listen on 445

apt remove smbclient samba samba-common && apt autoremove

See Also

TK: raindrop bookmarks

Samba

TK: samba docs in general: smbd, conf, build, general wiki refs

Elasticsearch and Spotlight

n.b. Elasticsearch 8.9.0 and newer are not compatible with Samba.

TK: spotlight, es, indexers, samba bugs

License

Original works in this repo are licensed under GPL3; see LICENSE in this repo.

Author

Chris Dzombak (github.com/cdzombak)

Docker Pull Command

docker pull cdzombak/samba-docker