ContainX / docker-volume-netshare

Docker NFS, AWS EFS, Ceph & Samba/CIFS Volume Plugin
http://netshare.containx.io
Apache License 2.0
1.12k stars 164 forks source link

Advantage of Netshare over Local Driver (most specifically, CIFS)? #144

Open jamiejackson opened 6 years ago

jamiejackson commented 6 years ago

I've been trying to get my head around how to give containers access to a samba share.

Options:

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 the cifs-utils package for local), but I suppose there's an advantage of using the distro repo's cifs-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.

rcarmo commented 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
trajano commented 6 years ago

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.-

trajano commented 6 years ago

One other advantage I found was netshare cifs allows for hostnames whereas I had to use IP addresses in the local mount.

jnovack commented 6 years ago

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".

trajano commented 6 years ago

@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.