SMB + Docker
from Dust0741@lemmy.world to selfhosted@lemmy.world on 08 Jan 15:37
https://lemmy.world/post/24028465
from Dust0741@lemmy.world to selfhosted@lemmy.world on 08 Jan 15:37
https://lemmy.world/post/24028465
Is there a way to setup an SMB share or similar via docker? I want to be able to easily turn it off and bind it to a specific folder, and I am comfortable with docker.
Thanks!
threaded - newest
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.
Awesome thank you!
Fruit? Really?
That
fruit
argument is so that samba plays nicely with Apple’s SMB client implementation.Those are quite the environment variable names there.
Yes, it’s explained in the documentation.
E.g.:
maps to:
This way you don’t need to provide any extra configuration file.
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.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.
I use dperson/samba, which is both simple and comes with usage examples.
The last commit was 5 years ago. There are very high chances the container image is full of vulnerabilities. You might wanna rebuild it yourself.
Excellent point, thank you!
There’s dockurr/samba which is also pretty easy to setup, but doesn’t allow much deviation from the defaults.