Run Samba on Docker-compose

How run samba with docker and docker-compose?

Docker-compose file for samba

mkdir -p /docker-compose/services/samba
cd /docker-compose/services/samba
vim docker-compose.yml

Add data to file

version: '3.4' services: samba: image: devsadds/samba:1.0.0 container_name: samba restart: unless-stopped stdin_open: true tty: true environment: # timszone, ex: 'Asia/Yekaterinburg' TZ: "Asia/Yekaterinburg" # advertise shares, default: true, or false (open ports 137, 138) NMBD: "true" # add a single user. If you need more, use command instead of environment # required arg: "<username>;<passwd>" # <username> for user # <password> for user # [ID] for user, default: "" # [group] for user, default: "" USER: "myuser;myspassword" # set the UID for the samba share, default: "" USERID: "0" # set the GID for the samba share, default: "" GROUPID: "0" # add a single share. If you need more, use command instead of environment # required arg: "<name>;</path>" # <share_name>; # <path_to_share>; # [browsable] default:'yes' or 'no'; # [read_only] default:'yes' or 'no'; # [guest]: default: 'yes' or 'no'; # [users]: default: 'all' or list of allowed users; # [admins] default: 'none' or list of admin users; # [writelist] default: 'none' or list of users that can write to read-only share; # [comment] default: 'none' or description of share SHARE: "share;/share1;yes;no;no;all;'none';'none';'share itc-life" # workgroup/domain name for share default: "MYGROUP" WORKGROUP: "WORKGROUP" # if set, disables recycle bin for shares RECYCLE: "" # if set, disables SMB2 minimum version # SMB: "" networks: - default ports: - "137:137/udp" # required to advertise shares (NMBD) - "138:138/udp" # required to advertise shares (NMBD) - "139:139/tcp" # default smb port - "445:445/tcp" # default smb port read_only: false tmpfs: - /tmp volumes: - /docker-compose/services/samba/data:/share1:z # :z allows share to be used by multiple containers networks: default:

And prepare folders for persistent data:

mkdir -p /docker-compose/services/samba/data

And run docker

docker-compose up -d

mount sambe

##mount -t cifs -o username=myuser,password=myspassword,uid=0 //$SERVER_IP/share /mnt/samba/itc-life

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *


Этот сайт использует Akismet для борьбы со спамом. Узнайте, как обрабатываются ваши данные комментариев.