I want to mount a CIFS share for my docker container to use. This already worked by explicitly creating a docker volume like so:
docker volume create --driver local --opt type=cifs --opt o=vers=2.0,username=xxxx,password=xxxx --opt device=//servername/Documents Documents
docker run -i --rm -v Documents:/mnt busybox ls -l /mnt
however I want to prevent that I have to create explicit volumes. As it has worked similarly for NFS volumes I now want to mount the volume in the docker run command directly:
docker run -i --rm --mount type=volume,volume-driver=local,dst=/mnt,volume-opt=type=cifs,volume-opt=o=vers=2.0,volume-opt=o=username=xxxx,volume-opt=device=//servername/Documents busybox ls -l /mnt
Here I am getting 'permission denied' errors, which is obvious as I have not used the password. How can I specify the password? All my attempts writing something produced different error messages.
docker run -i --rm --mount type=volume,volume-driver=local,dst=/mnt,volume-opt=type=cifs,volume-opt=o=vers=2.0,volume-opt=o=username=xxxx,password=xxxx,volume-opt=device=//servername/Documents busybox ls -l /mnt
gives me unexpected key 'password' in 'password=xxxx'
docker run -i --rm --mount type=volume,volume-driver=local,dst=/mnt,volume-opt=type=cifs,volume-opt=o=vers=2.0,volume-opt=o=username=xxxx,volume-opt=o=password=xxxx,volume-opt=device=//servername/Documents busybox ls -l /mnt
gives me password=xxxx: invalid argument.
My feeling is I need to somehow escape the comma but do not know how.