generated from pascaliske/docker-package
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
53 lines (41 loc) · 1.27 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# tini
FROM --platform=${BUILDPLATFORM} alpine:3.20 as tini
LABEL maintainer="[email protected]"
# environment
ENV TINI_VERSION=v0.19.0
ARG TARGETPLATFORM
# install tini
RUN case ${TARGETPLATFORM} in \
"linux/amd64") TINI_ARCH=amd64 ;; \
"linux/arm64") TINI_ARCH=arm64 ;; \
"linux/arm/v7") TINI_ARCH=armhf ;; \
esac \
&& wget -q https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static-${TINI_ARCH} -O /tini \
&& chmod +x /tini
# final image
FROM alpine:3.20
LABEL maintainer="[email protected]"
# environment
ENV UNBOUND_PORT=5053
# install unbound
RUN apk update && apk upgrade && apk add --no-cache \
gettext \
bind-tools \
openssl \
unbound
# inject built files
COPY --from=tini /tini /sbin/tini
# inject config files
COPY config/unbound.conf.tpl /etc/unbound/unbound.conf.tpl
# inject entrypoint
COPY docker-entrypoint.sh /docker-entrypoint.sh
# increase maximum receive window size
RUN echo "net.core.rmem_max=1048576" >> /etc/sysctl.conf
# health check
HEALTHCHECK CMD dig @127.0.0.1 -p ${UNBOUND_PORT} cloudflare.com || exit 1
# expose port
EXPOSE ${UNBOUND_PORT}/tcp
EXPOSE ${UNBOUND_PORT}/udp
# let's go!
ENTRYPOINT [ "/sbin/tini", "--", "/docker-entrypoint.sh" ]
CMD [ "/usr/sbin/unbound", "-v", "-d" ]