From 1ca5c0fc5ebdb4cf19eca844c72a2475a724e09c Mon Sep 17 00:00:00 2001 From: kev Date: Tue, 12 Apr 2016 18:28:27 +0800 Subject: [PATCH] fix samba volumes --- samba/Dockerfile | 3 +++ samba/README.md | 8 +++++--- samba/docker-compose.yml | 2 +- samba/smb.conf | 9 +++++++-- samba/smb.conf.sample | 20 ++++++++++++++++++++ 5 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 samba/smb.conf.sample diff --git a/samba/Dockerfile b/samba/Dockerfile index cb85654..201e856 100644 --- a/samba/Dockerfile +++ b/samba/Dockerfile @@ -11,6 +11,9 @@ RUN set -xe \ COPY smb.conf /etc/samba/ +VOLUME /etc/samba \ + /var/lib/samba + EXPOSE 137/udp \ 138/udp \ 139/tcp \ diff --git a/samba/README.md b/samba/README.md index 84a5afb..6d885f6 100644 --- a/samba/README.md +++ b/samba/README.md @@ -13,18 +13,20 @@ samba: image: vimagick/samba volumes: - ./smb.conf:/etc/samba/smb.conf - - ./share:/share + - /mnt/usb:/share net: host restart: always ``` +> An USB flash drive is mounted at `/mnt/usb`. + ## smb.conf ``` [global] +netbios name = easypi workgroup = WORKGROUP -netbios name = EasyPi -server string = Samba Server +server string = EasyPi Samba Server server role = standalone map to guest = bad user usershare allow guests = yes diff --git a/samba/docker-compose.yml b/samba/docker-compose.yml index 6cd13f7..86e2d13 100644 --- a/samba/docker-compose.yml +++ b/samba/docker-compose.yml @@ -2,6 +2,6 @@ samba: image: vimagick/samba volumes: - ./smb.conf:/etc/samba/smb.conf - - ./share:/share + - /mnt/usb:/share net: host restart: always diff --git a/samba/smb.conf b/samba/smb.conf index 1aed2c5..cd83050 100644 --- a/samba/smb.conf +++ b/samba/smb.conf @@ -1,7 +1,7 @@ [global] +netbios name = easypi workgroup = WORKGROUP -netbios name = EasyPi -server string = Samba Server +server string = EasyPi Samba Server dns proxy = no log file = /var/log/samba/log.%m max log size = 1000 @@ -18,6 +18,11 @@ map to guest = bad user usershare allow guests = yes load printers = no +[homes] +comment = Home Directories +browseable = no +writable = yes + [share] path = /share browseable = yes diff --git a/samba/smb.conf.sample b/samba/smb.conf.sample new file mode 100644 index 0000000..14f124b --- /dev/null +++ b/samba/smb.conf.sample @@ -0,0 +1,20 @@ +[global] + netbios name = easypi + workgroup = WORKGROUP + server string = EasyPi Samba Server + server role = standalone + map to guest = Bad User + usershare allow guests = yes + +[homes] + comment = Home Directories + browseable = no + writable = yes + +[share] + comment = Public File Sharing + path = /share + browseable = yes + writable = yes + guest ok = yes + admin users = root