Made the image a lot smaller

pull/1/head
Gertjan Krol 2022-01-22 02:17:59 +01:00
parent 2556e69cf1
commit 25267f015c
1 changed files with 13 additions and 12 deletions

View File

@ -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 \