initial commit for amdavidson/samba-server

This commit is contained in:
Andrew Davidson 2020-04-14 08:28:00 -04:00
commit 42507b0e38
Signed by: amd
GPG key ID: 17AF8F2A49CF25C6
3 changed files with 50 additions and 0 deletions

25
Dockerfile Normal file
View file

@ -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

14
etc/samba/smb.conf Normal file
View file

@ -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

11
run.sh Executable file
View file

@ -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