If you have your services in compose files, you can point the volumes to anywhere. Even NFS.
Like the below config
volumes: pihole01: driver: local driver_opts: type: 'none' o: 'bind' device: '/mnt/data/docker/pihole01'
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 posting.
Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.
Don't duplicate the full text of your blog or github here. Just post the link for folks to click.
Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).
No trolling.
Resources:
Any issues on the community? Report it using the report flag.
Questions? DM the mods!
If you have your services in compose files, you can point the volumes to anywhere. Even NFS.
Like the below config
volumes: pihole01: driver: local driver_opts: type: 'none' o: 'bind' device: '/mnt/data/docker/pihole01'
In general, container root filesystems and the images backing them will not function on NFS. When deploying containers, you should be mounting data volumes into the containers rather than storing things on the container root filesystems. Hopefully you are already doing that, otherwise you're going to need to manually copy data out of the containers. Personally, if all you're talking about is 32 gigs max, I would just stop all of the containers, copy everything to the new NFS locations, and then re-create the containers to point at the new NFS locations.
All this said though, some applications really don't like their data stored on NFS. I know Plex really doesn't function well when it's database is on NFS. But, the Plex media directories are fine to host from NFS.
If you want to move your containers to a different location, look into configuring docker's data-root
: https://stackoverflow.com/questions/24309526/how-to-change-the-docker-image-installation-directory
You copy /var/lib/docker
to a new location and update /etc/docker/daemon.json
I will say: Moving data-root to an NFS mount isn't going to work well. I've tried it, and docker containers rely on filesystem features to run their overlays. On an NFS, this feature isn't present, so your services will duplicate the container's entire filesystem. This will tank your performance and is basically unusable for anything but trivial examples. Docker data-root basically needs to be a "physical" disk.
I've had no issues using NFS shares mounted as docker volumes. It's just the data-root where it'll fail.
Your goal isn't super clear from the post.
Are you asking how to host an OS on an NFS share?