9

I am running Docker Version 17.09.0-ce-mac35 on mac. I want to have a samba server running as part of a docker container and then connect to the running samba server from my mac. I'm using https://github.com/dperson/samba for this.

I run the samba server like this:

➜  ~ sudo docker run -it -p 139:139 -p 445:445  -v /Users/anthony:/mount -d dperson/samba \
            -u "example1;badpass" \
            -u "example2;badpass" \
            -s "public;/share" \
            -s "users;/srv;no;no;no;example1,example2" \
            -s "example1 private;/example1;no;no;no;example1" \
            -s "example2 private;/example2;no;no;no;example2"

I can bash into the container and see all my files in /mount. However, when I try to connect to the samba server from mac in Finder > Go > Connect to server I get an error while connecting. I've tried the following:

smb://0.0.0.0
smb://localhost
smb://0.0.0.0/public
smb://localhost/public
smb://<docker_ip>/
smb://<docker_ip>/public

None of them work. Is there something I'm missing? Or is there another way to get a smb share running on a mac for test/playing around?

Anthony
  • 33,838
  • 42
  • 169
  • 278
  • Did you try setting the capabilities SYS_ADMIN and DAC_READ_SEARCH like explained here https://github.com/moby/moby/issues/22197? – Johannes Bleher Sep 18 '18 at 14:08

2 Answers2

0

Try to connect using the Samba user and local hostname: smb://example1@localhost

-3

You forget the port.

Try smb://ip:139/public

RobC
  • 22,977
  • 20
  • 73
  • 80
phat
  • 1
  • 2
    You only need to supply the port if you are using a non-default port. The default CIFS (smb over IP) ports are 139 and 445. – Tim Aug 31 '19 at 14:12