Open jamiejackson opened 6 years ago
I eventually gave up on this and figured out the local driver to my satisfaction, since I needed to use uid/gid mapping and there was no way I could figure out how to get it to work in Docker Compose.
After adding my mounts in /etc/fstab
, this is how I define the volumes in Compose:
volumes:
data:
driver: local
driver_opts:
type: none
device: /mnt/data
o: bind
You can avoid the race condition between the mounting of the volume and docker. You also set it up on the docker stack configuration which makes your node VM configuration simpler you just need the docker-netshare and docker.-
One other advantage I found was netshare cifs allows for hostnames whereas I had to use IP addresses in the local
mount.
The advantage comes in when you turn your kittens into cattle. When you stop caring about where something runs, just that something does.
For smaller shops, with 3 managers + X<10 Workers, it's easy to just mount nfs on every host because they all need it. Just give a top-level mount and let the containers bind to the second/third level directory as needed.
It's a subtle smaller difference that does not ROI until late in the game, but certainly in no way "plugin-for-a-plugin's-sake".
@jnovack I do agree for smaller shops it is easier. The only issue you may have is the hassle of creating another set of environments for development or testing.
I've been trying to get my head around how to give containers access to a samba share.
Options:
docker volume create
with--driver local
, which also avoids mounting from the host.I managed to get it working with Netshare ( https://github.com/ContainX/docker-volume-netshare/issues/143 ), but I wonder what this buys me over
docker volume create --driver local --opt type=cifs
.One way or the other, I have to install something extra on each Docker host, right? (
docker-volume-netshare
for Netshare, or thecifs-utils
package forlocal
), but I suppose there's an advantage of using the distro repo'scifs-utils
package, so it gets updated naturally.There's also no .rpm for Netshare (CentOS 7.4, FWIW), so I'd have to make a DIY service.
So what's the advantage (if any) of this plugin for CIFS, specifically, or for other mount types, generally? Did this fill a niche in the past that native Docker since evolved to fill?
With all that said, I haven't managed to get off the ground with the local driver yet. If you happen to know your way around the
--driver local
support, I would really appreciate some help over in my Docker forum post.