mayconjung/simple-smb

By mayconjung

Updated about 2 months ago

Simple samba server for fast file sharing, compatible with SMBv1.

Image
Databases & Storage

15

Simple-SMB

Fast and simple samba server compatible with SMBv1

This image uses Alpine Linux as the base OS to be as light as possible(i believe it can be enhanced). Only uses 10-30MB of RAM in plain usage(Different environments and usages may vary it's memory consumption).

Used to deploy as fast as possible a samba sharing for public/private sharing purposes. Originally designed to share a folder to PS2's OPL, but can be used to share anything with a quick deploy time with no complications.

PS: as you'll see in the next sessions, it's not the best solution to pass the users passwords as an env variable, but this project is meant to development/controlled environemnts only to avoid password leaks or any kind of problem.



Examples

Share a folder publicly: docker run -d -it -e SHARE="share_name_here" -v </path/to/local/folder>:/srv/samba/share -p 445:445 -p 139:139 -p 138:138 -p 137:137 --name <container_name> mayconjung/simple-smb:rev1

Share a folder private users: docker run -d -it -e SHARE="share_name_here" -e USER="user" -e USER_PASSWORD="password" -v </path/to/local/folder>:/srv/samba/share -p 445:445 -p 139:139 -p 138:138 -p 137:137 --name <container_name> mayconjung/simple-smb:rev1

Share a folder a list of users: docker run -d -it -e SHARE="share_name_here" -e USER="user1,user2,user3" -e USER_PASSWORD="pass1,pass2,pass3" -v </path/to/local/folder>:/srv/samba/share -p 445:445 -p 139:139 -p 138:138 -p 137:137 --name <container_name> mayconjung/simple-smb:rev1



Available volume mounts

/srv/samba/share
Default share folder, can be changed by setting SHARE_PATH env variable. - REQUIRED -
/etc/samba OR /etc/samba/smb.conf
Mount this folder/file if you want to use a custom config.
/var/log/samba
Samba logs folder, can me set by GLOBALS_LOG_FILE env variable.
/srv/lib/samba
tdbsam's database folder, not tested.



Ports

The used ports are the default ports for samba and netbios, which are: 445, 137, 138 and 139. Only the 445 and 139 are strictly needed for correct use.



Environment variables

Container's scope specific variables

SHARE

share's desired name

USER

a user OR a list of users separated by comma to authenticate(if blank, defaults to a public share, allowing guests to see and manipulate files the files)

USER_PASSWORD

if the above variable is set, it need to have the exact same amount of passwords to each user, throwing an error if the length does not match.

SAMBA VARIABLES

!!! MARKDOWN TO BE IMPLEMENTED !!!
GLOBALS
GLOBALS_WORKGROUP
GLOBALS_SERVER_STRING
GLOBALS_NETBIOS_NAME
GLOBALS_SECURITY
GLOBALS_MAP_TO_GUEST
GLOBALS_LOG_FILE
GLOBALS_MAX_LOG_SIZE
GLOBALS_LOAD_PRINTERS
GLOBALS_DNS_PROXY
GLOBALS_SMB_PORT
GLOBALS_LOCAL_MASTER
GLOBALS_PREFERRED_MASTER
GLOBALS_OS_LEVEL
GLOBALS_PASSDB_BACKEND
GLOBALS_ENCRYPT_PASSWORDS
GLOBALS_SERVER_MIN_PROTOCOL
GLOBALS_NTLM_AUTH
GLOBALS_LOG_LEVEL
SHARE VARIABLES
SHARE_COMMENT
SHARE_PATH
SHARE_BROWSEABLE
SHARE_READ_ONLY
SHARE_WRITABLE

Docker Pull Command

docker pull mayconjung/simple-smb