-
Notifications
You must be signed in to change notification settings - Fork 14
/
Dockerfile
36 lines (34 loc) · 1.02 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FROM alpine:latest AS unboundtest
RUN apk update
RUN apk add go
COPY *.go go.* /unboundtest-repo/
WORKDIR /unboundtest-repo
RUN GOBIN=/usr/bin CGO_ENABLED=0 go install .
FROM alpine:latest AS unbound
ARG UNBOUND_VERSION=1.19.1
RUN apk update
RUN apk add curl
RUN curl -o unbound.tgz https://nlnetlabs.nl/downloads/unbound/unbound-$UNBOUND_VERSION.tar.gz
RUN tar xzf unbound.tgz
RUN apk add \
flex \
bison \
openssl-dev \
openssl-libs-static \
libexpat \
expat-static \
expat-dev \
libev-dev \
build-base
WORKDIR unbound-$UNBOUND_VERSION
RUN ./configure --enable-fully-static && make
RUN install unbound /usr/sbin/unbound
FROM gcr.io/distroless/base-debian12
LABEL org.opencontainers.image.source=https://github.com/jsha/unboundtest
COPY --from=unboundtest /usr/bin/unboundtest /usr/bin/unboundtest
COPY --from=unbound /usr/sbin/unbound /usr/sbin/unbound
COPY index.html root.key /work/
COPY unbound.conf /etc/unbound/
WORKDIR /work/
EXPOSE 1232
CMD ["/usr/bin/unboundtest", "-unboundConfig", "/etc/unbound/unbound.conf"]