I am going to show you how to quickly set up a discoverable SMB share, it’s much easier than you think! Massive thanks to crazymax for his awesome docker containers that make this possible.
set up the SMB share
we’re going to use crazymax’s smb container, pretty easy to setup and docker native. its recommended to use host networking for it.
docker-compose.yml
|
|
don’t forget to change $TIMEZONE to your local timezone, list of tz time zones
Configuration
Unlike normal SMBd, the container uses YAML for configuration.
|
|
Here is a basic config for an open local share. All my files are owned by root, that’s why i need to force root as the default user.
Put the config in the mounted data folder, so in the case of compose file above, its ./smb/config.yml
You can add more shares or more users and far more in the config. More details about docker-smb’s configuration options are in the project’s GitHub repo
After this you should be able to use the SMB share, though not discoverable.
WSDD, SMB network discovery for Windows
Add this to the docker-compose.yml
file
|
|
just replace $HOSTNAME
with your hostname and then start the container
|
|
Now you should see the share with the $HOSTNAME
as its name in the network tab (if local device discovery is enabled) in Windows file explorer.
Avahi, SMB network discovery for MacOS and Linux
Add this to docker-compose.yml
, make sure to change $HOSTNAME
to whatever you want the share’s name to be.
|
|
avahi-services/smb.service
create the file smb.service
with the following content:
|
|
save it and start the container
|
|
You should now have Network discovery working on almost every OS!