diff --git a/samba b/samba new file mode 100644 index 0000000..dfd0467 --- /dev/null +++ b/samba @@ -0,0 +1,20 @@ +FROM ubuntu:22.04 + +RUN ! grep -E '^[^:]+:[^:]+:101:' /etc/passwd && \ + ! grep -E '^[^:]+:[^:]+:101:' /etc/group && \ + sed -e 's/^_apt:x:100:/_apt:x:101/' /etc/passwd > /tmp/passwd && \ + mv /tmp/passwd /etc/passwd +RUN groupadd --system smb --gid 101 && \ + useradd --system -M -g smb --uid 100 smbuser && \ + passwd -l smbuser +RUN apt-get update && \ + apt-get install -yy \ + --no-install-recommends \ + samba \ + samba-vfs-modules \ + && \ + rm -rf /var/lib/apt/lists/* + +EXPOSE 137/udp 138/tcp 139 445 + +CMD ["smbd", "--foreground", "--debuglevel=1", "--debug-stdout", "--no-process-group"]