Mine’s not in the context of Jenkins slaves, FWIW. (The direct mounting option just shows that it’s possible to mount the share with CIFS from the same host, so there’s something wrong with docker volume create or my use of it.)
it is not an issue with jenkins right. this is about creating cifs mount as volume in docker. In my case i am trying to mount this onto jenkins slave as second volume
Yes, the second reference in my original post details the docker-volume-netshare solution, but I’d like to explore the non-plugin option that supposedly works (but has no documentation).
The reason I say partially is I only got it to work in docker-compose but not in docker stack deploy
To make this fully work, I need to use the IP address rather than the host name for the device. In addition, if you improperly built this on the swarm you’d have to go to the worker and docker volume rm from there to make sure it gets recreated.
The way you’re doing it would be on the specific daemon much like docker-compose. I noted that there really isn’t an issue when doing it there, it’s more of a problem when you’re doing a docker stack deploy to a swarm.
using the sudo approach I take it you can do ls /mnt successfully? Also note the docker mount does not use the mount command by the syscall.Mount for NFS it does not work with host names. However, I did get it working with the host names for my CIFS share at one point. I switched over to a managed plugin now though so it can work in a swarm.
Yes, I can ls /mnt successfully when I use mount from the shell.
I have NFS mounting working perfectly using type=nfs with o=addr=hostname,... I did not need to use an IP address. Getting NFS mounting was so easy - I don’t understand why getting CIFS mounting working is so hard.
Out of interest, which plugin did you successfully use?
I used to use ContainX netshare volume plugin but I eventually opted to write my own docker volume plugins because I wanted to have them as managed plugins. That allows me to use CIFS or GlusterFS without having to install the cifs-utils or glusterfs-fuse packages on the host first (everything is self contained in the plugin’s container.
I also have a CentOS Mounted Volume Plugin that would allow you to mount arbitrary file systems assuming the packages are available for CentOS without having to install them directly on the host.