Skip to content

Trouble with CIFS Mount #143

Description

@jamiejackson

I struggled all day yesterday with this. Could you help me come up with a docker volume create command that satisfies the following requirements?

Requirements

  • type: cifs
  • username: user1
  • password: user1pass
  • share host: localhost
  • share directory: private
  • volume name: mediashare

Equivalent Plain Mount

For what it's worth, here's the equivalent mount command (note the vers=3.0 option--that was necessary):

mount -t cifs -o username=user1,password=user1pass,vers=3.0 \
   //localhost/private /tmp/mediashare

Failed Attempt

One of a hundred failed attempts:

Commands

nohup /mybin/docker-volume-netshare cifs --verbose=true &

docker volume create -d cifs \
  --name mediashare \
  --opt share=localhost/private \
  --opt username=user1 \
  --opt password=user1pass

docker run -it --rm -v mediashare:/tmp/mediashare -d --name samba-client alpine ash

Output from docker run

f3590287744080c6aee281ed4d61fe4476aed930030745e9736a592e4a78da94
docker: Error response from daemon: error while mounting volume '/var/lib/docker-volumes/netshare/cifs/mediashare': VolumeDriver.Mount: exit status 32.

Debug output

time="2017-11-12T15:48:11Z" level=warning msg="Error: open /root/.netrc: no such file or directory"
time="2017-11-12T15:48:11Z" level=info msg="== docker-volume-netshare :: Version: 0.18 - Built: 2016-05-27T20:14:07-07:00 =="
time="2017-11-12T15:48:11Z" level=info msg="Starting CIFS :: creds: { user=,pass=****,domain=,security= }, netrc: /root, opts: "
time="2017-11-12T15:48:11Z" level=debug msg="Entering Get: {mediashare map[]}"
time="2017-11-12T15:48:11Z" level=debug msg="Entering Get: {mediashare map[]}"
time="2017-11-12T15:48:11Z" level=debug msg="Entering Create: name: mediashare, options map[password:user1pass share:localhost/private username:user1]"
time="2017-11-12T15:48:11Z" level=debug msg="Create volume -> name: mediashare, map[password:user1pass share:localhost/private username:user1]"
time="2017-11-12T15:48:11Z" level=debug msg="Host path for mediashare is at /var/lib/docker-volumes/netshare/cifs/mediashare"
time="2017-11-12T15:48:11Z" level=debug msg="Entering List: { map[]}"
time="2017-11-12T15:48:12Z" level=debug msg="Entering Get: {mediashare map[]}"
time="2017-11-12T15:48:12Z" level=debug msg="Get: mount found for mediashare, host directory: /var/lib/docker-volumes/netshare/cifs/mediashare"
time="2017-11-12T15:48:12Z" level=info msg="Mount: mediashare, map[]"
time="2017-11-12T15:48:12Z" level=info msg="Mounting CIFS volume //localhost/private on /var/lib/docker-volumes/netshare/cifs/mediashare"
time="2017-11-12T15:48:12Z" level=debug msg="GetCreds: host=localhost, netrc=<nil>"
time="2017-11-12T15:48:12Z" level=debug msg="Executing: mount -t cifs -o guest,rw //localhost/private /var/lib/docker-volumes/netshare/cifs/mediashare\n"
2017/11/12 15:48:12 mount error(95): Not supported
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
mount: mounting //localhost/private on /var/lib/docker-volumes/netshare/cifs/mediashare failed: Invalid argument

Software Versions

  • docker-volume-netshare: Version: 0.18 - Built: 2016-05-27T20:14:07-07:00
  • docker: Docker version 17.10.0-ce, build f4ffd25

Note to self: Samba server was created with:

docker run --rm -it \
  -p 139:139 -p 445:445 -p 137:137/udp -p 138:138/udp -d \
  --name samba -v /tmp/server-sharestore-volume:/private \
  dperson/samba \
    -n -u user1;user1pass -u user2;user2pass \
    -s private;/private;yes;no;no;user1,user2;none;user1,user2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions