initial commit for amdavidson/samba-server
This commit is contained in:
commit
42507b0e38
3 changed files with 50 additions and 0 deletions
25
Dockerfile
Normal file
25
Dockerfile
Normal 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
14
etc/samba/smb.conf
Normal 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
11
run.sh
Executable 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
|
Loading…
Reference in a new issue