From 9e98b78e787a03e94f2c604927730c355c059977 Mon Sep 17 00:00:00 2001 From: chsteinle Date: Wed, 24 Nov 2021 10:26:42 +0100 Subject: [PATCH] Try to build up a samba server in docker. --- networking/Dockerfile | 24 ++++++++++++++++++++++++ networking/docker-compose.yaml | 16 +++++++++++++++- networking/smb.conf | 25 +++++++++++++++++++++++++ 3 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 networking/Dockerfile create mode 100644 networking/smb.conf diff --git a/networking/Dockerfile b/networking/Dockerfile new file mode 100644 index 0000000..3196f9d --- /dev/null +++ b/networking/Dockerfile @@ -0,0 +1,24 @@ +FROM alpine + +ARG VERSION + + +RUN set -xe && \ + apk add --no-cache \ + samba-server \ + samba-common-tools \ + +VOLUME /share +VOLUME /etc/samba + +COPY smb.conf /etc/samba/ + +EXPOSE 137/udp 138/udp 139/tcp 445/tcp + +ENTRYPOINT ["/usr/bin/entrypoint.sh"] + +CMD nmbd --daemon && \ + smbd --foreground \ + --log-stdout \ + --no-process-group \ + --configfile /etc/samba/smb.conf diff --git a/networking/docker-compose.yaml b/networking/docker-compose.yaml index 4940f32..66e9183 100644 --- a/networking/docker-compose.yaml +++ b/networking/docker-compose.yaml @@ -5,6 +5,8 @@ volumes: name: pihole dnsmasq: name: dnsmasq + samba-config: + name: samba-config # smokeping: # name: smokeping @@ -68,7 +70,6 @@ services: - pihole:/etc/pihole/ - dnsmasq:/etc/dnsmasq.d/ - unbound: image: mvance/unbound container_name: unbound @@ -82,6 +83,19 @@ services: - "53:53/udp" restart: always + samba: + build: . + container_name: samba + environment: + TZ: Europe/Berlin + network_mode: host + restart: unless-stopped + stdin_open: true + tty: true + volumes: + - samba-config:/etc/samba + - /media/backup:/share + # smokeping: # image: lscr.io/linuxserver/smokeping diff --git a/networking/smb.conf b/networking/smb.conf new file mode 100644 index 0000000..a629f11 --- /dev/null +++ b/networking/smb.conf @@ -0,0 +1,25 @@ +[global] + workgroup = WORKGROUP + server string = Odroid + server role = standalone server + hosts allow = 192.168.178. 127. + security = user + guest account = nobody + passdb backend = tdbsam + dns proxy = no + + load printers = no + printcap name = /dev/null + disable spoolss = yes + + directory mask = 0755 + force create mode = 0644 + force directory mode = 0755 + +[data] + comment = Data + path = /share + read only = no + writable = yes + printable = no + guest ok = no