Refrence: https://github.com/pengshp/samba
docker run -d -p 445:445 --hostname $HOSTNAME -e TZ=Asia/Shanghai \
-v /media:/share pengshp/samba \
-u "$(id -u):$(id -g):$(id -un):$(id -gn):pw" \
-s "SmbShare:/share:rw:$(id -un)"
version: '3.8'
services:
samba:
image: pengshp/samba
container_name: samba4
command: '-u "1000:1000:share:share:pw" -s "SmbShare:/share:rw:share"'
# command: '-u "uid:guid:username:groupname:password" -s "SmbShare:/share:rw:username"'
environment:
- TZ: 'Asia/Shanghai'
network_mode: host
volumes:
- ${pwd}/data/:/share
restart: unless-stopped
$ docker-compose up -d
$ docker-compose logs -f -n 20
Container will be configured as samba sharing server and it just needs:
add share, that is visible as 'name', exposing contents of 'path' directory for read+write (rw)
or read-only (ro) access for specified logins user1, user2, .., userN
On Windows point your filebrowser to \\host-ip\ to preview site.
Content type
Image
Digest
sha256:e8fde7e24…
Size
19.5 MB
Last updated
almost 3 years ago
docker pull pengshp/samba