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 FROM alpine:3.15.0
# Install required dependencies to build unbound (and bind-tools for dig in healthcheck) # Install required dependencies and build unbound (and install bind-tools for dig in healthcheck)
RUN apk update && apk add --no-cache alpine-sdk bind-tools expat-dev git libressl-dev 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) # Clone and build unbound source (https://github.com/NLnetLabs/unbound)
RUN mkdir -p /tmp/unbound git clone --depth 1 --branch 'release-1.14.0' https://github.com/NLnetLabs/unbound.git /tmp/unbound && \
RUN git clone --depth 1 --branch 'release-1.14.0' https://github.com/NLnetLabs/unbound.git /tmp/unbound cd /tmp/unbound && \
RUN cd /tmp/unbound && ./configure && make && make install ./configure && \
make && \
make install && \
make clean && \
# Cleanup build tools # Cleanup build tools
RUN apk del alpine-sdk expat-dev git rm -rf /tmp/* && \
RUN rm -rf /tmp/* apk del alpine-sdk expat-dev git openssl-dev
# Prepare unbound files # Prepare unbound files
COPY entrypoint.sh / COPY entrypoint.sh /
@ -18,7 +19,7 @@ RUN mkdir -p /srv/unbound
COPY unbound.conf /srv/unbound/unbound.conf COPY unbound.conf /srv/unbound/unbound.conf
# Prepare # Prepare
RUN adduser unbound --disabled-password RUN adduser -S unbound --disabled-password
# Health # Health
HEALTHCHECK --interval=60s --timeout=3s --retries=2 \ HEALTHCHECK --interval=60s --timeout=3s --retries=2 \