Skip to content

Commit bc4a5a9

Browse files
committed
docker/unbound: Build latest unbound package from salsa
1 parent 1655a3f commit bc4a5a9

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

unbound/Dockerfile

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,31 @@
1-
FROM public.ecr.aws/docker/library/golang:1.20-bullseye as build
1+
FROM public.ecr.aws/ubuntu/ubuntu:jammy as build-unbound
2+
3+
RUN apt-get update -qq && \
4+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends git git-buildpackage
5+
6+
WORKDIR /build/unbound
7+
RUN git clone --no-single-branch -b debian/1.17.1-2 --filter=tree:0 https://salsa.debian.org/dns-team/unbound.git .
8+
RUN apt-get build-dep -y .
9+
RUN gbp buildpackage -b -uc -us -j"$(nproc)" --git-ignore-branch --git-no-pristine-tar
10+
11+
###
12+
13+
FROM public.ecr.aws/docker/library/golang:1.20-bullseye as build-exporter
214

315
RUN go install github.com/hanazuki/unbound_exporter@679dfa54debd24456ed458a7e72590101b560e2b
416

517
###
618

719
FROM public.ecr.aws/ubuntu/ubuntu:jammy
820

9-
RUN apt-get update -qq && \
10-
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends unbound dns-root-data dumb-init
21+
RUN --mount=type=bind,from=build-unbound,src=/build,dst=/build \
22+
apt-get update -qq && \
23+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends /build/unbound_*.deb dns-root-data dumb-init && \
24+
rm -rf /var/lib/apt/lists/*
1125

12-
COPY --from=build /go/bin/unbound_exporter /usr/local/bin/
26+
COPY --from=build-exporter /go/bin/unbound_exporter /usr/local/bin/
1327

14-
RUN /usr/lib/unbound/package-helper root_trust_anchor_update
15-
RUN rm /etc/unbound/unbound_*.key /etc/unbound/unbound_*.pem
28+
RUN /usr/libexec/unbound-helper root_trust_anchor_update
1629

1730
COPY entrypoint.sh /
1831
RUN chmod +x entrypoint.sh

0 commit comments

Comments
 (0)