Skip to content
vmiimu edited this page Jun 16, 2018 · 6 revisions

Welcome to the samba wiki!


Example Usage For Common Sharing Scenarios

Concise and repurposable examples to illustrate common usage.
Open invite to add / update additional examples.

Create a read only share accessible by anyone at docker host ip.

Optionally:

  • Choose a name for the container
  • Set container to restart automatically
  • Enable the nmbd daemon to advertise the shares

Assuming:
Docker host has a folder /shared and should be accessible as \\host_ip\share_name

Command:
docker run -it --name samba --restart always --net=host -p 139:139 -p 455:455 -p 137:137/udp -p 138:138/udp -v /shared:/v_shared -d dperson/samba -s "share;/v_shared" -n

Explaination:
docker run -it docker run interactive terminal
--name samba [optional] pick a name for our container
--restart always [optional] auto restart on reboot
--net=host using the default host network
-p 139:139 -p 455:455 default smb port bindings
-p 137:137/udp -p 138:138/udp [optional] port bindings for 'nmbd' daemon to advertise the shares
-v /shared:/v_shared host folder /shared and where it will be mounted in the container /v_shared
-d dperson/samba container image
-s "share_name;/v_shared" the share nameshare_name and folder in container /v_shared to share
-n [optional] Start the 'nmbd' daemon to advertise the shares

Clone this wiki locally