diff --git a/examples/samba/Dockerfile.dnsmasq b/examples/samba/Dockerfile.dnsmasq new file mode 100644 index 0000000..05e944b --- /dev/null +++ b/examples/samba/Dockerfile.dnsmasq @@ -0,0 +1,20 @@ +FROM opensuse/leap:15.6 AS ref_repo + +RUN zypper --non-interactive mr -e -a &&\ + zypper --non-interactive --gpg-auto-import-keys ref --force && \ + zypper --non-interactive in hostname vim tcpdump iputils iproute2 dnsmasq + +COPY examples/samba/dnsmasq.conf /etc/dnsmasq.conf +COPY examples/samba/dnsmasq-hosts.conf /etc/dnsmasq-hosts.conf +COPY examples/samba/entrypoint.dnsmasq /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] +SHELL ["/bin/bash", "--login", "-c"] +CMD ["/bin/bash", "--login"] + +# Added as part of the pkg install +USER dnsmasq +WORKDIR /var/lib/empty + +EXPOSE 53/tcp +EXPOSE 53/udp diff --git a/examples/samba/dnsmasq-hosts.conf b/examples/samba/dnsmasq-hosts.conf new file mode 100644 index 0000000..35f052b --- /dev/null +++ b/examples/samba/dnsmasq-hosts.conf @@ -0,0 +1,6 @@ + +192.168.66.215 krimedc.example.com +192.168.66.215 samba.example.com + + + diff --git a/examples/samba/dnsmasq.conf b/examples/samba/dnsmasq.conf new file mode 100644 index 0000000..320456a --- /dev/null +++ b/examples/samba/dnsmasq.conf @@ -0,0 +1,17 @@ + +log-queries + +addn-hosts=/etc/dnsmasq-hosts.conf + +server=192.168.66.1 + +# Quad 9 fallback +# server=9.9.9.11 +# server=149.112.112.11 + +srv-host =_kerberos._tcp.example.com,krimedc.example.com,88 +srv-host =_kerberos-master._tcp.example.com,krimedc.example.com,88 +txt-record=_kerberos.example.com,"EXAMPLE.COM" + + + diff --git a/examples/samba/docker-compose.yml b/examples/samba/docker-compose.yml index 4824fbc..453fcd1 100644 --- a/examples/samba/docker-compose.yml +++ b/examples/samba/docker-compose.yml @@ -23,9 +23,8 @@ services: networks: static-network: ipv4_address: 192.168.238.10 - expose: - - "88" - - "88/udp" + ports: + - "88:88" samba: depends_on: @@ -51,8 +50,25 @@ services: networks: static-network: ipv4_address: 192.168.238.11 - expose: - - "445" + ports: + - "445:445" + + dnsmasq: + restart: no + build: + context: ../../ + dockerfile: ./examples/samba/Dockerfile.dnsmasq + image: libkrimes:dnsmasq + container_name: libkrimes_dnsmasq + hostname: dnsmasq + domainname: example.com + dns_search: example.com + networks: + static-network: + ipv4_address: 192.168.238.12 + ports: + - "53:53/tcp" + - "53:53/udp" volumes: samba-keytab: diff --git a/examples/samba/entrypoint.dnsmasq b/examples/samba/entrypoint.dnsmasq new file mode 100755 index 0000000..2e78211 --- /dev/null +++ b/examples/samba/entrypoint.dnsmasq @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -euo pipefail + +/usr/sbin/dnsmasq --log-async --log-facility=- --keep-in-foreground --conf-file=/etc/dnsmasq.conf + + diff --git a/examples/samba/krbtgt.keytab b/examples/samba/krbtgt.keytab new file mode 100644 index 0000000..43691be Binary files /dev/null and b/examples/samba/krbtgt.keytab differ