Docker container of Samba, an implementation of the Windows SMB networking protocol.
Original container forked from dockur/samba.
This fork is configured to focus more on implementing a multi-user share using Samba homes shares.
Via Docker Compose:
services:
samba:
image: ghcr.io/brodybuster/samba:latest
container_name: samba
ports:
- 445:445
volumes:
- /home/example/data:/storageVia Docker CLI:
docker run -it -d -p 445:445 -v "/home/example/data:/storage" ghcr.io/brodybuster/samba:latestDefault credentials are samba:secret, but changing these credentials is recommended.
You can connect to a share by using the following address: [server-address]/[user name]
On Windows Explorer, this looks like \\192.168.2.2\samba, where "192.168.2.2" is replaced with the address of the server behind this container, and "samba" is replaced by the username".
By default this container is configured to host a share for user "samba" with password "secret".
You can change the default credentials or add more users inside the provided users file, and bind that file to /run/secrets/users, or use it as a Docker secret if working with Docker Swarm.
Passwords are stored as NTLM MD4 hashes. To generate a NTLM MD4 hash, consider using the following command:
iconv -f ASCII -t UTF-16LE <(printf "password") | openssl dgst -MD4 -provider legacy | cut -d " " -f2
replacing "password" with the desired user's password.
You can implement group shares by modifying the provided groupshares file, and bind that file to /run/secrets/groupshares, or use it as a Docker secret if working with Docker Swarm.
If you need more advanced features, you can completely override the default configuration by modifying the smb.conf file in this repo, and bind your custom config to the container like this:
volumes:
- /example/smb.conf:/etc/samba/smb.confThis repo now publishes the image with GitHub Actions from .github/workflows/docker-publish.yml.
What gets published:
- Push to
master: updatesghcr.io/brodybuster/samba:latestandghcr.io/brodybuster/samba:sha-<commit> - Push a tag like
v1.2.3: additionally publishes:v1.2.3and:1.2.3
Required GitHub repository settings:
Settings -> Actions -> General -> Workflow permissions: set toRead and write permissions
Release flow:
git push origin master
git tag v1.0.0
git push origin v1.0.0The workflow builds and pushes a multi-arch image for linux/amd64 and linux/arm64.
Build with BuildKit:
DOCKER_BUILDKIT=1 docker build . -t ghcr.io/brodybuster/samba:devOr have the following configuration in your daemon.json:
{
"features": {
"buildkit": true
}
}Then build normally with docker build . -t ghcr.io/brodybuster/samba:dev.
For more information, refer to the official Docker docs.
