how to connect to samba server running in docker
Asked Answered
F

2

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?

Ferdinandferdinanda answered 23/6, 2018 at 11:24 Comment(1)
Did you try setting the capabilities SYS_ADMIN and DAC_READ_SEARCH like explained here github.com/moby/moby/issues/22197?Fordham
P
0

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

Pennell answered 1/4, 2020 at 3:26 Comment(1)
I did the same and still problem. It was working but suddenly after once system restart it is notSulphurize
C
-3

You forget the port.

Try smb://ip:139/public

Crumbly answered 31/8, 2019 at 14:4 Comment(1)
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.Brochette

© 2022 - 2024 — McMap. All rights reserved.