A collection of containers built using the official Gentoo Docker Images.
- Direct access to
smb.conf- Samba has too many configuration options to pass via environment variables, so it's best to manually modify it to fit the use case.smb.confis located in the/configdata volume at/config/samba/smb.conf. It can be modified using eitherviornanofrom inside the container, or theconfigshare via your favorite editor. - Auto reload on
smb.confchange - Thesamba-configservice will monitorsmb.conffor changes and automatically reloadsmbd. - Persistent users and groups - System users and groups can be added using the
standard
useraddandgroupadd, modified usingusermodandgroupmod, and deleted usinguserdelandgroupdel. The modifications will be stored in the/configdata volume at/config/passwdand/config/groups. If you need to manually modify one of these files while your container is running usevipw(vi passwd) orvigr(vi group). It will make sure the changes get correctly applied to the container and/configvolume.- Persistent home directories - Home directories are created in the
/datavolume at/data/home/<user>. TheHomesshare is enabled by default. add user script- The defaultsmb.confhas theadd user scriptconfigured to automatically create a system user. This means you can usesmbpasswd -a <user>to add a new samba user an it will automatically create a system user.
- Persistent home directories - Home directories are created in the
- Modern discovery protocols - NetBIOS has been deprecated and is no longer
enabled by default on new Windows 10 installs.
- Avahi - Provides auto discovery and name resolution for OS X and mDNS
clients. The container will appear in the OS X network browser and be
resolvable using
<hostname>.local. - WSDD - Web Service Discovery provides auto discovery to Windows clients and allows the samba server to be listed in the network browser. This is the replacement for NetBIOS.
- Avahi - Provides auto discovery and name resolution for OS X and mDNS
clients. The container will appear in the OS X network browser and be
resolvable using
- OS X support - In order to get proper OS X support, the
fruitvfs object needs to be enabled and configured. The defaultsmb.confcorrectly configuresvfs_fruitfor linux.- Time Machine support - The default
smb.confhas support for Time Machine. Users don't have to do anything special. The backups will be stored in the users$HOME. - xattr verification -
vfs_fruitand Time Machine require xattr support from the underlying filesystem. By defaultext4does not havexattrsupport enabled without adding theuser_xattrflag. On container startup a warning will be printed if any shares don't have support forxattrs enabled. Additionally the Time Machine share will refuse to work and print an error in the console ifxattrsare not enabled. This prevents hard to diagnose errors while performing a backup.
- Time Machine support - The default
- Logging controls - Set
DEBUG=1to enable verbose logging to debug the container.
-
NTFS Alternate Data Streams are implemented using using the streams_xattr vfs object.
ext4has a very small (1 KiB - 4 KiB) limit for xattrs, so this may cause compatability problems with applications that use ADS. See man xattr for specifics.XFS,ZFS, andReiserFSdon't have this limit. It is recommended to use one of those filesystems for the best compatability. The linux VFS still imposes a 64 KiB limit though. -
Multicast discovery will only work if the container is joined directly to your LAN. It won't function through the bridge network. You will need to create a macvlan network.
i.e.,
docker network create -d macvlan \ --subnet=192.168.32.0/24 \ --ip-range=192.168.32.128/25 \ --gateway=192.168.32.1 \ -o parent=eth0 lan
docker run -it --rm
--network lan \
--name grizmos \
--hostname grizmos \
--mount source=grizmos-config,target=/config \
--mount source=grizmos-data,target=/data \
ismell/gentoo-samba:latestYou will now have a samba server running on your LAN named grizmos. It will
show up in the OS X network browser and the Windows 10 network browser.
In order to modify smb.conf, you have two options:
- Add a password for the root user and edit
smb.confvia theconfigshare.
docker exec -it "$(docker ps -f name=grizmos -q)" smbpasswd -a rootNow use your favorite editor to navigate to \\grizmos\config\samba\smb.conf
- Directly using
viornano
docker exec -it "$(docker ps -f name=grizmos -q)" vi /config/samba/smb.confIn both cases if you look at the logs, you will notice the samba-config
service will reload smbd when smb.conf is modified.
Local users are managed using the standard tools.
Adding a local user and setting a samba password can be accomplished with a single command:
docker exec -it "$(docker ps -f name=grizmos -q)" smbpasswd -a cumuloThis user will have a home directory created at /data/home/cumulo and can be
accessed via \\grizmos\cumulo. Time Machine backups will also be stored in
/data/home/cumulo/TimeMachineBackup.
If you need to add a user with a specific UID you can do the following:
docker exec -it "$(docker ps -f name=grizmos -q)" useradd -u 1234 bartleby
docker exec -it "$(docker ps -f name=grizmos -q)" smbpasswd -a bartleby