Samba Docker image based on Alpine Linux.
If you are interested, check out my other Docker images!
💡 Want to be notified of new releases? Check out 🔔 Diun (Docker Image Update Notifier) project!
- Features
- Build locally
- Image
- Environment variables
- Volumes
- Ports
- Configuration
- Usage
- Notes
- Upgrade
- Contributing
- License
- Multi-platform image
- Easy configuration through YAML
- Improve operability with Mac OS X clients
- Drop support for legacy protocols including NetBIOS, WINS, and Samba port 139
git clone https://github.com/crazy-max/docker-samba.git
cd docker-samba
# Build image and output to docker (default)
docker buildx bake
# Build multi-platform image
docker buildx bake image-all
Registry | Image |
---|---|
Docker Hub | crazymax/samba |
GitHub Container Registry | ghcr.io/crazy-max/samba |
Following platforms for this image are available:
$ docker run --rm mplatform/mquery crazymax/samba:latest
Image: crazymax/samba:latest
* Manifest List: Yes
* Supported platforms:
- linux/amd64
- linux/arm/v6
- linux/arm/v7
- linux/arm64
- linux/386
- linux/ppc64le
- linux/s390x
TZ
: Timezone assigned to the container (defaultUTC
)SAMBA_WORKGROUP
: NT-Domain-Name or Workgroup-Name. (defaultWORKGROUP
)SAMBA_SERVER_STRING
: Server string is the equivalent of the NT Description field. (defaultDocker Samba Server
)SAMBA_LOG_LEVEL
: Log level. (default0
)SAMBA_FOLLOW_SYMLINKS
: Allow to follow symlinks. (defaultyes
)SAMBA_WIDE_LINKS
: Controls whether or not links in the UNIX file system may be followed by the server. (defaultyes
)SAMBA_HOSTS_ALLOW
: Set of hosts which are permitted to access a service. (default127.0.0.0/8 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16
)SAMBA_INTERFACES
: Allows you to override the default network interfaces list.
More info: https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html
/data
: Contains cache, configuration and runtime data
445
: SMB over TCP port
More info: https://wiki.samba.org/index.php/Samba_NT4_PDC_Port_Usage
Before using this image you have to create the YAML configuration file /data/config.yml
to be able to create users,
provide global options and add shares. Here is an example:
auth:
- user: foo
group: foo
uid: 1000
gid: 1000
password: bar
- user: baz
group: xxx
uid: 1100
gid: 1200
password_file: /run/secrets/baz_password
global:
- "force user = foo"
- "force group = foo"
share:
- name: foo
path: /samba/foo
browsable: yes
readonly: no
guestok: no
validusers: foo
writelist: foo
veto: no
veto: no
is a list of predefined files and directories that will not be
visible or accessible:
/._*/.apdisk/.AppleDouble/.DS_Store/.TemporaryItems/.Trashes/desktop.ini/ehthumbs.db/Network Trash Folder/Temporary Items/Thumbs.db/
More info: https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html#VETOFILES
A more complete example is available here.
Docker compose is the recommended way to run this image. Copy the content of folder examples/compose
in /var/samba/
on your host for example. Edit the compose and configuration files with your preferences and run the
following commands:
docker-compose up -d
docker-compose logs -f
You can also use the following minimal command:
docker run -d --network host \
-v "$(pwd)/data:/data" \
--name samba crazymax/samba
Recreate the container whenever I push an update:
docker-compose pull
docker-compose up -d
Use the following commands to check the logs and status:
docker-compose logs samba
docker-compose exec samba smbstatus
Want to contribute? Awesome! The most basic way to show your support is to star the project, or to raise issues. You can also support this project by becoming a sponsor on GitHub or by making a Paypal donation to ensure this journey continues indefinitely!
Thanks again for your support, it is much appreciated! 🙏
MIT. See LICENSE
for more details.