From 8fa139e77db2d589be8272cadc5d86e65442f96d Mon Sep 17 00:00:00 2001 From: Michael Elkerton Date: Tue, 28 Jul 2026 18:46:42 -0600 Subject: [PATCH] init --- .env | 1 + Dockerfile | 15 +++++++++++++++ Makefile | 17 +++++++++++++++++ etc/unbound/unbound.conf | 11 +++++++++++ 4 files changed, 44 insertions(+) create mode 100644 .env create mode 100644 Dockerfile create mode 100644 Makefile create mode 100644 etc/unbound/unbound.conf diff --git a/.env b/.env new file mode 100644 index 0000000..8303ced --- /dev/null +++ b/.env @@ -0,0 +1 @@ +VERSION=0.0.1 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6b20799 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM alpine:3.20 + +RUN apk add --no-cache unbound + +# Default config location; mount your own unbound.conf over this +COPY /etc/unbound/unbound.conf /etc/unbound/unbound.conf + +# Unbound needs write access to its run/chroot dirs +RUN mkdir -p /var/lib/unbound && \ + unbound-anchor -a /var/lib/unbound/root.key || true + +EXPOSE 53/udp 53/tcp + +ENTRYPOINT ["unbound", "-d", "-c", "/etc/unbound/unbound.conf"] + diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1ae5837 --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ +include .env + +GIT_URL=git.mspe.ca +image: + docker build -t unbound:build . + +up: + docker compose up + +tag: + docker tag unbound:build ${GIT_URL}/docker/unbound:${VERSION} + docker image ls + +push: + docker push ${GIT_URL}/docker/unbound:${VERSION} + +test: image up diff --git a/etc/unbound/unbound.conf b/etc/unbound/unbound.conf new file mode 100644 index 0000000..a44b81d --- /dev/null +++ b/etc/unbound/unbound.conf @@ -0,0 +1,11 @@ +server: + verbosity: 1 + interface: 0.0.0.0 + port: 53 + do-ip4: yes + do-ip6: no + do-udp: yes + do-tcp: yes + access-control: 0.0.0.0/0 allow + root-hints: "/var/lib/unbound/root.hints" + auto-trust-anchor-file: "/var/lib/unbound/root.key"