From d6e7cddebd804cc2a085cadb68da901a930e1c91 Mon Sep 17 00:00:00 2001 From: kev Date: Sun, 6 Mar 2016 17:37:18 +0800 Subject: [PATCH] update samba --- samba/Dockerfile | 10 +++++++--- samba/README.md | 20 +++++++++++++++----- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/samba/Dockerfile b/samba/Dockerfile index 6f6b4ee..4ae5569 100644 --- a/samba/Dockerfile +++ b/samba/Dockerfile @@ -5,11 +5,15 @@ FROM alpine MAINTAINER kev -RUN apk add -U samba-common-tools samba-server \ +RUN set -xe \ + && apk add -U samba-common-tools samba-server \ && rm -rf /var/cache/apk/* COPY smb.conf /etc/samba/ -EXPOSE 137/udp 138/udp 139/tcp 445/tcp +EXPOSE 137/udp \ + 138/udp \ + 139/tcp \ + 445/tcp -CMD smbd --foreground --log-stdout +CMD ["smbd", "--foreground", "--log-stdout"] diff --git a/samba/README.md b/samba/README.md index 25034a1..f038210 100644 --- a/samba/README.md +++ b/samba/README.md @@ -3,7 +3,7 @@ samba ![](https://badge.imagelayers.io/vimagick/samba:latest.svg) -[`Samba`][1] is the standard Windows interoperability suite of programs for +[Samba][1] is the standard Windows interoperability suite of programs for Linux and Unix. ## docker-compose.yml @@ -17,8 +17,8 @@ samba: - "139:139/tcp" - "445:445/tcp" volumes: - - smb.conf:/etc/samba/smb.conf - - share:/share + - ./smb.conf:/etc/samba/smb.conf + - ./share:/share restart: always ``` @@ -28,11 +28,12 @@ samba: [global] workgroup = WORKGROUP server string = %h server (Samba, Apline) +map to guest = bad user [share] path = /share browseable = yes -read only = yes +read only = no guest ok = yes ``` @@ -54,7 +55,16 @@ Retype new SMB password:****** ## client ``` -$ smbutil view smb://server +$ 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 ``` [1]: https://www.samba.org/