1
2
mirror of https://github.com/vimagick/dockerfiles synced 2024-06-16 03:48:44 +00:00
dockerfiles/samba
2016-04-07 09:46:55 +08:00
..
docker-compose.yml fix samba 2016-04-07 09:46:55 +08:00
Dockerfile fix samba 2016-04-07 09:46:55 +08:00
README.md fix samba 2016-04-07 09:46:55 +08:00
smb.conf update smb.conf 2016-04-07 09:10:18 +08:00

samba

Samba is the standard Windows interoperability suite of programs for Linux and Unix.

docker-compose.yml

samba:
  image: vimagick/samba
  volumes:
    - ./smb.conf:/etc/samba/smb.conf
    - ./share:/share
  net: host
  restart: always

smb.conf

[global]
workgroup = WORKGROUP
netbios name = EasyPi
server string = Samba Server
map to guest = bad user

[share]
path = /share
browseable = yes
read only = no
guest ok = yes
admin users = root

server

$ cd ~/fig/samba
$ mkdir share
$ touch share/README.txt
$ docker-compose up -d
$ docker exec -it samba_samba_1 sh
>>> smbpasswd -a root
New SMB password:******
Retype new SMB password:******
>>> exit

client

$ smbutil view -NG smb://easypi
Share                                           Type    Comments
-------------------------------
share                                           Disk
IPC$                                            Pipe    IPC Service (Samba Server)
2 shares listed

$ mkdir -p /Volumes/share
$ mount_smbfs //guest@easypi/share /Volumes/share
$ umount /Volumes/share

root user can read and write, guest user can read only.