Ancestors

Written by Dust0741@lemmy.world on 2025-01-08 at 15:37

SMB + Docker

https://lemmy.world/post/24028465

=> More informations about this toot | More toots from Dust0741@lemmy.world

Written by mbirth@lemmy.ml on 2025-01-08 at 15:46

services:

server:

image: ghcr.io/servercontainers/samba:latest

restart: unless-stopped

network_mode: host

environment:

  TZ: Europe/London

  MODEL: MacSamba

  SAMBA_GLOBAL_STANZA: "vfs objects = acl_xattr catia fruit streams_xattr; fruit:nfs_aces = no; inherit permissions = yes; fruit:model = MacSamba; fruit:posix_rename = yes; fruit:veto_appledouble = no; fruit:wipe_intentionally_left_blank_rfork = yes; fruit:delete_empty_adfiles = yes; fruit:metadata = stream"

  SAMBA_GLOBAL_CONFIG_load_SPACE_printers: no

  SAMBA_GLOBAL_CONFIG_printing: bsd

  SAMBA_GLOBAL_CONFIG_printcap_SPACE_name: /dev/null

  SAMBA_GLOBAL_CONFIG_disable_SPACE_spoolss: yes

  SAMBA_GLOBAL_CONFIG_min_SPACE_protocol: SMB2

  SAMBA_GLOBAL_CONFIG_bind_SPACE_interfaces_SPACE_only: yes

  SAMBA_GLOBAL_CONFIG_interfaces: lo eth0

  SAMBA_CONF_SERVER_STRING: Docker Host Samba

  #SAMBA_CONF_LOG_LEVEL: 3

  ACCOUNT_shareuser: mypassword

  UID_shareuser: 1000

  # avahi seems to introduce issues with the share

  # "The operation can't be completed because the original item for "xxx" can't be found."

  AVAHI_DISABLE: true

  WSDD2_DISABLE: true

  #NETBIOS_DISABLE: true

  SAMBA_VOLUME_CONFIG_myshare: "[myshare]; path=/shares/myshare; valid users = shareuser; guest ok = no; read only = no; browseable = yes"

volumes:

  - /path/to/myshare:/shares/myshare

Just make sure you don’t have any local SMB server running on the host. And if you need multiple different shares, these all need to go into the same container or you need to define different ports if you use multiple containers.

=> More informations about this toot | More toots from mbirth@lemmy.ml

Written by ikidd@lemmy.world on 2025-01-09 at 15:49

Those are quite the environment variable names there.

=> More informations about this toot | More toots from ikidd@lemmy.world

Written by mbirth@lemmy.ml on 2025-01-09 at 20:59

Yes, it’s explained in the documentation.

E.g.:

maps to:

bind interfaces only = yes

This way you don’t need to provide any extra configuration file.

=> More informations about this toot | More toots from mbirth@lemmy.ml

Written by ikidd@lemmy.world on 2025-01-10 at 01:10

I’m well aware of how inline environment variables work, but that is one helldammer of a name for one, and I rarely see anyone use actual spaces in .env file variable, let alone translate a space to SPACE in a variable name.

=> More informations about this toot | More toots from ikidd@lemmy.world

Toot

Written by mbirth@lemmy.ml on 2025-01-10 at 03:32

These variable names are dynamically parsed and used for generating the smb.conf.

And if you need a way to support underscores AND spaces (which are not allowed in a variable name), you have to get creative.

I like the solution as it allows me to encode any possible configuration value (even the most obscure one) in the compose file.

=> More informations about this toot | More toots from mbirth@lemmy.ml

Descendants

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113801949770042138
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
281.034397 milliseconds
Gemini-to-HTML Time
2.448293 milliseconds

This content has been proxied by September (3851b).