-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
faf1561
commit 17bd1f6
Showing
6 changed files
with
562 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
FROM debian:bullseye as openssl | ||
|
||
ENV VERSION_OPENSSL=openssl-3.0.5 \ | ||
SHA256_OPENSSL=aa7d8d9bef71ad6525c55ba11e5f4397889ce49c2c9349dcea6d3e4f0b024a7a \ | ||
SOURCE_OPENSSL=https://www.openssl.org/source/ \ | ||
OPGP_OPENSSL=7953AC1FBC3DC8B3B292393ED5E9E43F7DF9EE8C | ||
|
||
WORKDIR /tmp/src | ||
|
||
RUN set -e -x && \ | ||
build_deps="build-essential ca-certificates curl dirmngr gnupg libidn2-0-dev libssl-dev" && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y --no-install-recommends \ | ||
$build_deps && \ | ||
curl -L $SOURCE_OPENSSL$VERSION_OPENSSL.tar.gz -o openssl.tar.gz && \ | ||
echo "${SHA256_OPENSSL} ./openssl.tar.gz" | sha256sum -c - && \ | ||
curl -L $SOURCE_OPENSSL$VERSION_OPENSSL.tar.gz.asc -o openssl.tar.gz.asc && \ | ||
GNUPGHOME="$(mktemp -d)" && \ | ||
export GNUPGHOME && \ | ||
gpg --no-tty --keyserver keyserver.ubuntu.com --recv-keys "$OPGP_OPENSSL" && \ | ||
gpg --batch --verify openssl.tar.gz.asc openssl.tar.gz && \ | ||
tar xzf openssl.tar.gz && \ | ||
cd $VERSION_OPENSSL && \ | ||
./Configure linux-x32 && \ | ||
./config \ | ||
--prefix=/opt/openssl \ | ||
--openssldir=/opt/openssl \ | ||
no-weak-ssl-ciphers \ | ||
no-ssl3 \ | ||
no-shared \ | ||
-DOPENSSL_NO_HEARTBEATS \ | ||
-fstack-protector-strong && \ | ||
make depend && \ | ||
nproc | xargs -I % make -j% && \ | ||
make install_sw && \ | ||
apt-get purge -y --auto-remove \ | ||
$build_deps && \ | ||
rm -rf \ | ||
/tmp/* \ | ||
/var/tmp/* \ | ||
/var/lib/apt/lists/* | ||
|
||
FROM debian:bullseye as unbound | ||
|
||
ENV NAME=unbound \ | ||
UNBOUND_VERSION=1.16.1 \ | ||
UNBOUND_SHA256=2fe4762abccd564a0738d5d502f57ead273e681e92d50d7fba32d11103174e9a \ | ||
UNBOUND_DOWNLOAD_URL=https://nlnetlabs.nl/downloads/unbound/unbound-1.16.1.tar.gz | ||
|
||
WORKDIR /tmp/src | ||
|
||
COPY --from=openssl /opt/openssl /opt/openssl | ||
|
||
RUN build_deps="curl gcc libc-dev libevent-dev libexpat1-dev libnghttp2-dev make" && \ | ||
set -x && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y --no-install-recommends \ | ||
$build_deps \ | ||
bsdmainutils \ | ||
ca-certificates \ | ||
ldnsutils \ | ||
libevent-2.1-7 \ | ||
libexpat1 && \ | ||
curl -sSL $UNBOUND_DOWNLOAD_URL -o unbound.tar.gz && \ | ||
echo "${UNBOUND_SHA256} *unbound.tar.gz" | sha256sum -c - && \ | ||
tar xzf unbound.tar.gz && \ | ||
rm -f unbound.tar.gz && \ | ||
cd unbound-1.16.1 && \ | ||
groupadd _unbound && \ | ||
useradd -g _unbound -s /etc -d /dev/null _unbound && \ | ||
./configure \ | ||
--disable-dependency-tracking \ | ||
--prefix=/opt/unbound \ | ||
--with-pthreads \ | ||
--with-username=_unbound \ | ||
--with-ssl=/opt/openssl \ | ||
--with-libevent \ | ||
--with-libnghttp2 \ | ||
--enable-tfo-server \ | ||
--enable-tfo-client \ | ||
--enable-event-api && \ | ||
make install && \ | ||
mv /opt/unbound/etc/unbound/unbound.conf /opt/unbound/etc/unbound/unbound.conf.example && \ | ||
apt-get purge -y --auto-remove \ | ||
$build_deps && \ | ||
rm -rf \ | ||
/opt/unbound/share/man \ | ||
/tmp/* \ | ||
/var/tmp/* \ | ||
/var/lib/apt/lists/* | ||
|
||
FROM debian:bullseye | ||
|
||
WORKDIR /tmp/src | ||
|
||
COPY --from=unbound /opt /opt | ||
|
||
RUN set -x && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y --no-install-recommends \ | ||
bsdmainutils \ | ||
ca-certificates \ | ||
ldnsutils \ | ||
libevent-2.1-7 \ | ||
libnghttp2-14 \ | ||
libexpat1 && \ | ||
groupadd _unbound && \ | ||
useradd -g _unbound -s /etc -d /dev/null _unbound && \ | ||
apt-get purge -y --auto-remove \ | ||
$build_deps && \ | ||
rm -rf \ | ||
/opt/unbound/share/man \ | ||
/tmp/* \ | ||
/var/tmp/* \ | ||
/var/lib/apt/lists/* | ||
|
||
COPY data/ / | ||
|
||
RUN chmod +x /unbound.sh | ||
|
||
WORKDIR /opt/unbound/ | ||
|
||
ENV PATH /opt/unbound/sbin:"$PATH" | ||
|
||
LABEL org.opencontainers.image.version=${UNBOUND_VERSION} \ | ||
org.opencontainers.image.title="mvance/unbound-rpi" \ | ||
org.opencontainers.image.description="a validating, recursive, and caching DNS resolver" \ | ||
org.opencontainers.image.url="https://github.com/MatthewVance/unbound-docker-rpi" \ | ||
org.opencontainers.image.vendor="Matthew Vance" \ | ||
org.opencontainers.image.licenses="MIT" \ | ||
org.opencontainers.image.source="https://github.com/MatthewVance/unbound-docker-rpi" | ||
|
||
EXPOSE 53/tcp | ||
EXPOSE 53/udp | ||
|
||
HEALTHCHECK --interval=30s --timeout=30s --start-period=10s --retries=3 CMD drill @127.0.0.1 cloudflare.com || exit 1 | ||
|
||
CMD ["/unbound.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# A Record | ||
#local-data: "somecomputer.local. A 192.168.1.1" | ||
|
||
# PTR Record | ||
#local-data-ptr: "192.168.1.1 somecomputer.local." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
forward-zone: | ||
# Forward all queries (except those in cache and local zone) to | ||
# upstream recursive servers | ||
name: "." | ||
# Queries to this forward zone use TLS | ||
forward-tls-upstream: yes | ||
|
||
# https://dnsprivacy.org/wiki/display/DP/DNS+Privacy+Test+Servers | ||
|
||
## Cloudflare | ||
forward-addr: 1.1.1.1@853#cloudflare-dns.com | ||
forward-addr: 1.0.0.1@853#cloudflare-dns.com | ||
#forward-addr: 2606:4700:4700::1111@853#cloudflare-dns.com | ||
#forward-addr: 2606:4700:4700::1001@853#cloudflare-dns.com | ||
|
||
## CleanBrowsing Security Filter | ||
# forward-addr: 185.228.168.9@853#security-filter-dns.cleanbrowsing.org | ||
# forward-addr: 185.228.169.9@853#security-filter-dns.cleanbrowsing.org | ||
# forward-addr: 2a0d:2a00:1::2@853#security-filter-dns.cleanbrowsing.org | ||
# forward-addr: 2a0d:2a00:2::2@853#security-filter-dns.cleanbrowsing.org | ||
|
||
## CleanBrowsing Adult Filter | ||
# forward-addr: 185.228.168.10@853#adult-filter-dns.cleanbrowsing.org | ||
# forward-addr: 185.228.169.11@853#adult-filter-dns.cleanbrowsing.org | ||
# forward-addr: 2a0d:2a00:1::1@853#adult-filter-dns.cleanbrowsing.org | ||
# forward-addr: 2a0d:2a00:2::1@853#adult-filter-dns.cleanbrowsing.org | ||
|
||
## CleanBrowsing Family Filter | ||
# forward-addr: 185.228.168.168@853#family-filter-dns.cleanbrowsing.org | ||
# forward-addr: 185.228.169.168@853#family-filter-dns.cleanbrowsing.org | ||
# forward-addr: 2a0d:2a00:1::@853#family-filter-dns.cleanbrowsing.org | ||
# forward-addr: 2a0d:2a00:2::@853#family-filter-dns.cleanbrowsing.org | ||
|
||
## Quad9 | ||
# forward-addr: 9.9.9.9@853#dns.quad9.net | ||
# forward-addr: 149.112.112.112@853#dns.quad9.net | ||
# forward-addr: 2620:fe::fe@853#dns.quad9.net | ||
# forward-addr: 2620:fe::9@853#dns.quad9.net | ||
|
||
## getdnsapi.net | ||
# forward-addr: 185.49.141.37@853#getdnsapi.net | ||
# forward-addr: 2a04:b900:0:100::37@853#getdnsapi.net | ||
|
||
## Surfnet | ||
# forward-addr: 145.100.185.15@853#dnsovertls.sinodun.com | ||
# forward-addr: 145.100.185.16@853#dnsovertls1.sinodun.com | ||
# forward-addr: 2001:610:1:40ba:145:100:185:15@853#dnsovertls.sinodun.com | ||
# forward-addr: 2001:610:1:40ba:145:100:185:16@853#dnsovertls1.sinodun.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# SRV records | ||
# _service._proto.name. | TTL | class | SRV | priority | weight | port | target. |
Oops, something went wrong.