Docker Community Forums

Share and learn in the Docker community.

Accessing a samba share inside a running linux container

Greetings Docker community,

while testing a linux container with a running samba service I noticed that I am unable to access
the samba shares using the windows explorer with the containers IP e.g. \\10.0.75.1

Either this is empty or simply shows the shared drives (if set up in the Docker Desktop settings)

Is this a problem when using Docker Desktop for Windows over running Docker on Linux (or a Linux VM on Windows) or is there something I am missing or did configured wrong?

As far as I am aware this could be an port issue since the windows explorer always uses port 445 to access SMB which sadly cannot be changed.

I’d love some of your feedback and experience if there is a way to get this working.

Thanks!
Florian

ok, I just fixed this or better understood what is going on here.
So other might also resolve this, I’d like to share:

Docker Desktop for Windows has a virtual network configured using an Subnet e.g. 10.0.75.0

When Docker Desktop is started the Docker VM receives the the first IP e.g. 10.0.75.1
Using this IP in the windows explorer will open/display/show the Docker VM shares as configured in the Docker Desktop settings.

Each additional started container will receive the next IP from the Subnet e.g. 10.0.75.2, 10.0.75.3, 10.0.75.4, …

So my first container running the samba uses IP 10.0.75.2 and therefore I have to use \10.0.75.2 in the windows explorer to gain access to the samba shares.

It is so simple yet I did not understand it until now.
I hope this will help others to resolve their issues as well as to understand what is going on!

Cheers,
Florian