Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions samba/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Inspired by https://hub.docker.com/r/silvershell/samba/
FROM debian:bookworm

ENV SMB_USER smbuser
ENV SMB_PASSWORD smbpassword

RUN apt-get update && apt-get install -y \
samba \
smbclient \
&& rm -rf /var/lib/apt/lists/*

RUN mkdir -p /opt/samba/share
RUN chmod 777 /opt/samba/share

RUN mkdir -p /opt/samba/user
RUN chmod 777 /opt/samba/user

RUN useradd -s /bin/false "$SMB_USER"
RUN (echo "$SMB_PASSWORD"; echo "$SMB_PASSWORD" ) | pdbedit -a -u "$SMB_USER"

EXPOSE 137/udp 138/udp 139 445

COPY smb.conf /etc/samba/smb.conf

CMD /usr/sbin/smbd --daemon --foreground --debug-stdout
46 changes: 46 additions & 0 deletions samba/smb.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[global]
security = user

load printers = no
printcap name = /dev/null
printing = bsd

unix charset = UTF-8
dos charset = CP932

workgroup = WORKGROUP

server string = %h server (Samba, Ubuntu)
dns proxy = no
interfaces = eth* lo
bind interfaces only = no
log file = /var/log/samba/log.%m
max log size = 1000
syslog = 0
panic action = /usr/share/samba/panic-action %d
server role = standalone server
passdb backend = tdbsam
obey pam restrictions = yes
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
pam password change = yes
map to guest = Bad User
usershare allow guests = yes

[public]
path = /opt/samba/share
writable = yes
printable = no
public = yes
guest only = yes
create mode = 0777
directory mode = 0777

[user]
path = /opt/samba/user
writable = yes
printable = no
public = no
create mode = 0777
directory mode = 0777