1
2
mirror of https://github.com/vimagick/dockerfiles synced 2024-06-30 18:51:24 +00:00
dockerfiles/samba/README.md

71 lines
1.3 KiB
Markdown
Raw Normal View History

2015-07-17 14:53:21 +00:00
samba
=====
2015-07-17 15:11:33 +00:00
![](https://badge.imagelayers.io/vimagick/samba:latest.svg)
2016-03-06 09:37:18 +00:00
[Samba][1] is the standard Windows interoperability suite of programs for
2015-07-17 15:11:33 +00:00
Linux and Unix.
## docker-compose.yml
```
samba:
image: vimagick/samba
ports:
- "137:137/udp"
- "138:138/udp"
- "139:139/tcp"
- "445:445/tcp"
volumes:
2016-03-06 09:37:18 +00:00
- ./smb.conf:/etc/samba/smb.conf
- ./share:/share
2015-07-17 15:11:33 +00:00
restart: always
```
## smb.conf
```
[global]
workgroup = WORKGROUP
server string = %h server (Samba, Apline)
2016-03-06 09:37:18 +00:00
map to guest = bad user
2015-07-17 15:11:33 +00:00
[share]
path = /share
browseable = yes
2016-03-06 09:37:18 +00:00
read only = no
2015-07-17 15:11:33 +00:00
guest ok = yes
```
## server
```
$ cd ~/fig/samba
2015-07-17 15:50:28 +00:00
$ mkdir share
$ chmod 777 share
$ touch share/README.txt
2015-07-17 15:11:33 +00:00
$ docker-compose up -d
$ docker exec -it samba_samba_1 sh
2015-07-17 15:50:28 +00:00
>>> smbpasswd -a root
New SMB password:******
Retype new SMB password:******
2015-07-17 15:11:33 +00:00
>>> exit
```
## client
```
2016-03-06 09:37:18 +00:00
$ smbutil view -NG smb://server
Share Type Comments
-------------------------------
share Disk
IPC$ Pipe IPC Service (52e5ac2d2d7c server (Samba, Apline))
2 shares listed
$ mkdir -p /Volumes/share
$ mount_smbfs //guest@server/share /Volumes/share
$ umount /Volumes/share
2015-07-17 15:11:33 +00:00
```
2015-07-17 14:53:21 +00:00
[1]: https://www.samba.org/