Created
February 11, 2020 18:16
-
-
Save advanceboy/a315d83d900929103d858a461b673e52 to your computer and use it in GitHub Desktop.
Launch authenticationt-less SMB with alpine+Samba
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM alpine:3.10 | |
RUN mkdir -p /samba/share && \ | |
chmod -R 0777 /samba/share && \ | |
chown -R nobody:nobody /samba/share | |
# install samba | |
RUN apk update && \ | |
apk add samba | |
RUN { \ | |
echo "[global]"; \ | |
echo " security = user"; \ | |
echo " map to guest = Bad User"; \ | |
echo " guest account = nobody"; \ | |
echo " min protocol = SMB2"; \ | |
echo "[public]"; \ | |
echo " path = /samba/share"; \ | |
echo " writable = yes"; \ | |
echo " guest ok = yes"; \ | |
echo " guest only = yes"; \ | |
echo " create mode = 0666"; \ | |
echo " directory mode = 0777"; \ | |
} > /etc/samba/smb.conf | |
EXPOSE 139 445 | |
# start smbd as foreground | |
ENTRYPOINT ["/bin/ash"] | |
CMD ["-c", "nmbd restart -D && smbd restart -FS --no-process-group </dev/null"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment