Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BREAKING: Move runtime chroot directory to /var/unbound #253

Merged
merged 2 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ People _love_ thorough bug reports. I'm not even kidding.
1. Optionally update root hints before building

```bash
rm rootfs_overlay/etc/unbound/root.hints
wget https://www.internic.net/domain/named.root -O rootfs_overlay/etc/unbound/root.hints
rm rootfs_overlay/var/unbound/root.hints
wget https://www.internic.net/domain/named.root -O rootfs_overlay/var/unbound/root.hints
```

2. Enable docker buildkit and experimental mode
Expand Down
13 changes: 7 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,11 @@ RUN echo "${UNBOUND_SHA256} unbound.tar.gz" | sha256sum -c - \
# https://unbound.docs.nlnetlabs.nl/en/latest/getting-started/installation.html#building-from-source-compiling
RUN ./configure \
--prefix=/opt/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--with-conf-file=/etc/unbound/unbound.conf \
--with-run-dir=/var/unbound \
--with-chroot-dir=/var/unbound \
--with-pidfile=/var/unbound/unbound.pid \
--with-rootkey-file=/var/unbound/root.key \
--disable-static \
--disable-shared \
--disable-rpath \
Expand Down Expand Up @@ -110,10 +113,8 @@ COPY --from=unbound /opt/usr/sbin/ /usr/sbin/

COPY --from=ldns /opt/usr/bin/ /usr/bin/

COPY --chown=unbound:unbound rootfs_overlay/ /

# TODO: run as non-root on port 5053
# USER unbound
COPY --chown=unbound:unbound rootfs_overlay/etc/unbound/ /etc/unbound/
COPY --chown=unbound:unbound rootfs_overlay/var/unbound/ /var/unbound/

RUN [ "unbound", "-V" ]
# hadolint ignore=DL3059
Expand Down
4 changes: 2 additions & 2 deletions rootfs_overlay/etc/unbound/unbound.conf
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,14 @@ server:
# nameserver names and addresses only. The default may become outdated,
# when servers change, therefore it is good practice to use a root-hints
# file. get one from https://www.internic.net/domain/named.root
root-hints: /etc/unbound/root.hints
root-hints: root.hints

# File with trust anchor for one zone, which is tracked with RFC5011 probes.
# The probes are several times per month, thus the machine must be online frequently.
# The initial file can be one with contents as described in trust-anchor-file.
# The file is written to when the anchor is updated, so the unbound user must
# have write permission.
auto-trust-anchor-file: /etc/unbound/root.key
auto-trust-anchor-file: root.key

# Number of ports to open. This number of file descriptors can be opened per thread.
# Must be at least 1. Default depends on compile options. Larger numbers need extra
Expand Down