this post was submitted on 01 Feb 2025
64 points (97.1% liked)
Selfhosted
59897 readers
556 users here now
A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.
Rules:
-
Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.
-
No spam.
-
Posts here are to be centered around self-hosting. Please ensure it is clear in your post how it relates to self-hosting.
-
Don't duplicate the full text of your blog or git here. Just post the link for folks to click.
-
Submission headline should match the article title.
-
No trolling.
Resources:
- selfh.st Newsletter and index of selfhosted software and apps
- awesome-selfhosted software
- awesome-sysadmin resources
- Self-Hosted Podcast from Jupiter Broadcasting
Any issues on the community? Report it using the report flag.
Questions? DM the mods!
founded 3 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Or just something as simple as using a SMB/CIFS share for your data. Instead of mounting the share before running your container, you can make Docker do it by specifying it like this:
For
typeyou can use anything you have amount.<type>tool available, e.g. on my Raspberry this would be:And the
oparameter is everything you would put as options to the mount command (e.g. in the 4th column in/etc/fstab). In the case of smb3, you can runmount.smb3 --helpto see a list of available options.Doing it this way, Docker will make sure the share is mounted before running the container. Also, if you move the compose file to a different host, it'll just work if the share is reachable from that new location.
Ok I did not know about this at all. I've been just mounting it on the host which has been a bit of a pain at times.
I just did a massive refactor of my stacks, but now I might have to revisit them to do this.
There's also an NFSv4 driver which is great when you're running TrueNAS
Wow thanks for this! Reading the official docker documentation I somehow missed this. Using regular well documented linux mount. tools and options will be so much better than looking for docker-specific documentation for every single type.
And knowing the docker container won't start unless the mount is available solves so much.
Does the container stop or freeze if the mount becomes unavailable? For example if the smb share host goes offline?