docker compose 搭建 windows 共享 samba
docker-compose
root@homenas:/laojia/samba# cat docker-compose.yaml version: '3' networks: net10: external: name: laojia services: samba: image: dperson/samba restart: always volumes: - ./data:/pico - /tmp:/pico2 ports: - 139:139 - 445:445 environment: USER: "laojia;laojia" SHARE: "picovr;/pico;no;no;no;laojia;laojia" SHARE: "read;/pico2;no;no;no;laojia" networks: net10: ipv4_address: 10.10.100.10
上面定义一个用户: laojia 密码也是 laojia
一个共享目录:picovr 权限为 laojia 为管理员
一个共享目录:read, 权限为 laojia 只读
USER
定义 访问共享的用户名、密码
SHARE
定义共享目录;具体参数如下
"<name;/path>[;browse;readonly;guest;users;admins;writelist;comment]"
name: 必须, 共享路径名字
path:必须,映射的目录
下满是可选的参数,空值代表默认
browsable: 可见;yes或no; 默认yes
readonly: 只读;yes或no;默认yes
guest:允许guest访问;yes或no;默认yes
下面是访问用户的设置,多个用,隔开
users: 允许访问的用户;默认 all所有
admins:管理员;默认 none
writelist:可以向 readonly 写入的用户
comment:对share的描述
更多设置查看:https://hub.docker.com/r/dperson/samba
0顶
0 踩
共 0 条评论