-
Notifications
You must be signed in to change notification settings - Fork 28
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
257e2bf
commit cbfdaee
Showing
3 changed files
with
145 additions
and
2 deletions.
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
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
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,143 @@ | ||
FROM debian:buster as openssl | ||
LABEL maintainer="Matthew Vance" | ||
|
||
ENV VERSION_OPENSSL=openssl-1.1.1g \ | ||
SHA256_OPENSSL=ddb04774f1e32f0c49751e21b67216ac87852ceb056b75209af2443400636d46 \ | ||
SOURCE_OPENSSL=https://www.openssl.org/source/ \ | ||
OPGP_OPENSSL=8657ABB260F056B1E5190839D9C4D26D0E604491 | ||
|
||
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 ipv4.pool.sks-keyservers.net --recv-keys "$OPGP_OPENSSL" \ | ||
|| gpg --no-tty --keyserver ha.pool.sks-keyservers.net --recv-keys "$OPGP_OPENSSL" ) && \ | ||
gpg --batch --verify openssl.tar.gz.asc openssl.tar.gz && \ | ||
tar xzf openssl.tar.gz && \ | ||
cd $VERSION_OPENSSL && \ | ||
./config \ | ||
--prefix=/opt/openssl \ | ||
--openssldir=/opt/openssl \ | ||
no-weak-ssl-ciphers \ | ||
no-ssl3 \ | ||
no-shared \ | ||
enable-ec_nistp_64_gcc_128 \ | ||
-DOPENSSL_NO_HEARTBEATS \ | ||
-fstack-protector-strong && \ | ||
make depend && \ | ||
make && \ | ||
make install_sw && \ | ||
apt-get purge -y --auto-remove \ | ||
$build_deps && \ | ||
rm -rf \ | ||
/tmp/* \ | ||
/var/tmp/* \ | ||
/var/lib/apt/lists/* | ||
|
||
FROM debian:buster as unbound | ||
LABEL maintainer="Matthew Vance" | ||
|
||
ENV NAME=unbound \ | ||
UNBOUND_VERSION=1.10.1 \ | ||
UNBOUND_SHA256=b73677c21a71cf92f15cc8cfe76a3d875e40f65b6150081c39620b286582d536 \ | ||
UNBOUND_DOWNLOAD_URL=https://nlnetlabs.nl/downloads/unbound/unbound-1.10.1.tar.gz | ||
|
||
WORKDIR /tmp/src | ||
|
||
COPY --from=openssl /opt/openssl /opt/openssl | ||
|
||
RUN build_deps="curl gcc libc-dev libevent-dev libexpat1-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-6 \ | ||
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.10.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 \ | ||
--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:buster | ||
LABEL maintainer="Matthew Vance" | ||
|
||
ENV NAME=unbound \ | ||
VERSION=1.0 \ | ||
SUMMARY="${NAME} is a validating, recursive, and caching DNS resolver." \ | ||
DESCRIPTION="${NAME} is a validating, recursive, and caching DNS resolver." | ||
|
||
LABEL summary="${SUMMARY}" \ | ||
description="${DESCRIPTION}" \ | ||
io.k8s.description="${DESCRIPTION}" \ | ||
io.k8s.display-name="Unbound ${UNBOUND_VERSION}" \ | ||
name="mvance/${NAME}" \ | ||
maintainer="Matthew Vance" | ||
|
||
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-6\ | ||
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 a-records.conf /opt/unbound/etc/unbound/ | ||
COPY unbound.sh / | ||
|
||
RUN chmod +x /unbound.sh | ||
|
||
WORKDIR /opt/unbound/ | ||
|
||
ENV PATH /opt/unbound/sbin:"$PATH" | ||
|
||
EXPOSE 53/tcp | ||
EXPOSE 53/udp | ||
|
||
HEALTHCHECK --interval=5s --timeout=3s --start-period=5s CMD drill @127.0.0.1 cloudflare.com || exit 1 | ||
|
||
CMD ["/unbound.sh"] |