Made the image a lot smaller
parent
2556e69cf1
commit
25267f015c
21
Dockerfile
21
Dockerfile
|
@ -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 \
|
||||||
|
|
Loading…
Reference in New Issue