docker-volume-netshare icon indicating copy to clipboard operation
docker-volume-netshare copied to clipboard

Unable to mount CIFS volume when path contains space

Open josalmi opened this issue 8 years ago • 1 comments

I have problem mounting CIFS share when the path contains a space. I was able to mount the volume using the command as docker-volume-netshare shown in the logs when I wrapped mount points around ".

Commands run:

docker volume create -d cifs --name "cifs1/User dir" --opt username=user --opt password=****
docker run -it -v "cifs1/User dir:/cifs1" alpine sh

Mount command from logs:

mount -t cifs -o username=user,password=****,rw //cifs1/User dir /var/lib/docker-volumes/netshare/cifs/cifs1/User dir

Manual command:

mount -t cifs -o username=user,password=****,rw "//cifs1/User dir" "/var/lib/docker-volumes/netshare/cifs/cifs1/User dir"

josalmi avatar Jul 06 '17 14:07 josalmi

Hi

I found a workaround. You need to use both double and single quotes around the share parameter, for instance:

docker volume create -d cifs --name user_dir --opt share="'cifs1/User dir'" --opt username=user --opt password=****

Eduardo-Alves avatar Jul 20 '17 14:07 Eduardo-Alves