From 27dfe7bed009747bce096e98dd3242a4ad0edca4 Mon Sep 17 00:00:00 2001 From: kev Date: Fri, 17 Jul 2015 23:11:33 +0800 Subject: [PATCH] update --- samba/Dockerfile | 2 -- samba/README.md | 53 +++++++++++++++++++++++++++++++++++++++- samba/docker-compose.yml | 5 +++- samba/smb.conf | 4 +-- 4 files changed, 58 insertions(+), 6 deletions(-) diff --git a/samba/Dockerfile b/samba/Dockerfile index 71f2579..6f6b4ee 100644 --- a/samba/Dockerfile +++ b/samba/Dockerfile @@ -10,8 +10,6 @@ RUN apk add -U samba-common-tools samba-server \ COPY smb.conf /etc/samba/ -VOLUME /etc/samba - EXPOSE 137/udp 138/udp 139/tcp 445/tcp CMD smbd --foreground --log-stdout diff --git a/samba/README.md b/samba/README.md index afa200f..357ce02 100644 --- a/samba/README.md +++ b/samba/README.md @@ -1,6 +1,57 @@ samba ===== -[`Samba`][1] is the standard Windows interoperability suite of programs for Linux and Unix. +![](https://badge.imagelayers.io/vimagick/samba:latest.svg) + +[`Samba`][1] is the standard Windows interoperability suite of programs for +Linux and Unix. + +## docker-compose.yml + +``` +samba: + image: vimagick/samba + ports: + - "137:137/udp" + - "138:138/udp" + - "139:139/tcp" + - "445:445/tcp" + volumes: + - smb.conf:/etc/samba/smb.conf + - share:/share + restart: always +``` + +## smb.conf + +``` +[global] +workgroup = WORKGROUP +server string = %h server (Samba, Apline) + +[share] +path = /share +browseable = yes +read only = yes +guest ok = yes +``` + +## server + +``` +$ cd ~/fig/samba +$ docker-compose up -d +$ docker exec -it samba_samba_1 sh +>>> chmod 777 /share +>>> adduser kev +>>> smbpasswd -a kev +>>> exit +``` + +## client + +``` +$ smbutil view smb://server +``` [1]: https://www.samba.org/ diff --git a/samba/docker-compose.yml b/samba/docker-compose.yml index 21408e5..c2b089b 100644 --- a/samba/docker-compose.yml +++ b/samba/docker-compose.yml @@ -1,8 +1,11 @@ samba: - build: . + image: vimagick/samba ports: - "137:137/udp" - "138:138/udp" - "139:139/tcp" - "445:445/tcp" + volumes: + - smb.conf:/etc/samba/smb.conf + - share:/share restart: always diff --git a/samba/smb.conf b/samba/smb.conf index 217c099..2201bbc 100644 --- a/samba/smb.conf +++ b/samba/smb.conf @@ -21,8 +21,8 @@ printing = none printcap name = /dev/null disable spoolss = yes -[root] -path = /root +[share] +path = /share browseable = yes read only = yes guest ok = yes