From 25267f015c4a9bcdd6d7d3cb54ede86019cbf382 Mon Sep 17 00:00:00 2001 From: Gertjan Date: Sat, 22 Jan 2022 02:17:59 +0100 Subject: [PATCH] Made the image a lot smaller --- Dockerfile | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 61c5721..e160d80 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,17 @@ FROM alpine:3.15.0 -# Install required dependencies to build unbound (and bind-tools for dig in healthcheck) -RUN apk update && apk add --no-cache alpine-sdk bind-tools expat-dev git libressl-dev - -# Clone and build unbound source (https://github.com/NLnetLabs/unbound) -RUN mkdir -p /tmp/unbound -RUN git clone --depth 1 --branch 'release-1.14.0' https://github.com/NLnetLabs/unbound.git /tmp/unbound -RUN cd /tmp/unbound && ./configure && make && make install - -# Cleanup build tools -RUN apk del alpine-sdk expat-dev git -RUN rm -rf /tmp/* +# Install required dependencies and build unbound (and install bind-tools for dig in healthcheck) +RUN apk --update add --no-cache alpine-sdk bind-tools expat-dev git openssl-dev && \ + # Clone and build unbound source (https://github.com/NLnetLabs/unbound) + git clone --depth 1 --branch 'release-1.14.0' https://github.com/NLnetLabs/unbound.git /tmp/unbound && \ + cd /tmp/unbound && \ + ./configure && \ + make && \ + make install && \ + make clean && \ + # Cleanup build tools + rm -rf /tmp/* && \ + apk del alpine-sdk expat-dev git openssl-dev # Prepare unbound files COPY entrypoint.sh / @@ -18,7 +19,7 @@ RUN mkdir -p /srv/unbound COPY unbound.conf /srv/unbound/unbound.conf # Prepare -RUN adduser unbound --disabled-password +RUN adduser -S unbound --disabled-password # Health HEALTHCHECK --interval=60s --timeout=3s --retries=2 \