From 42507b0e3859f6c24161e39ea9db40990d66b351 Mon Sep 17 00:00:00 2001 From: Andrew Davidson Date: Tue, 14 Apr 2020 08:28:00 -0400 Subject: [PATCH] initial commit for amdavidson/samba-server --- Dockerfile | 25 +++++++++++++++++++++++++ etc/samba/smb.conf | 14 ++++++++++++++ run.sh | 11 +++++++++++ 3 files changed, 50 insertions(+) create mode 100644 Dockerfile create mode 100644 etc/samba/smb.conf create mode 100755 run.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1b70ae4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +FROM debian:buster-slim + +RUN apt-get update \ +&& apt-get install -y samba + +ARG USER=share +ARG SMBPW=do_not_use_insecure + +RUN groupadd -g 5858 "$USER" \ +&& useradd -u 5858 -g 5858 "$USER" \ +&& (echo "$SMBPW";echo "$SMBPW") | smbpasswd -sa "$USER" + +EXPOSE 137/udp 138/udp 139 445 + +RUN mkdir /share && chown share:share /share && chmod 0777 /share + +VOLUME /share + +COPY ./etc /etc + +COPY run.sh ./ + +CMD ./run.sh + + diff --git a/etc/samba/smb.conf b/etc/samba/smb.conf new file mode 100644 index 0000000..1fe256f --- /dev/null +++ b/etc/samba/smb.conf @@ -0,0 +1,14 @@ +[global] + workgroup = WORKGROUP + +[share] + comment = Shared files on Royal + read only = no + writeable = yes + locking = no + path = /share + guest ok = no + valid users = share + available = yes + public = no + force user = share diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..00cc679 --- /dev/null +++ b/run.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +echo "Setting password to $SMBPW" + +(echo "$SMBPW"; echo "$SMBPW") | smbpasswd -sa share + +if [ $? -eq 0 ]; then + + smbd -FS + +fi