-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathDockerfile
74 lines (59 loc) · 2.18 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
FROM debian:10.10-slim as dnsmasq
ARG DNSMASQ_VERSION="2.85"
ENV DNSMASQ_VERSION=${DNSMASQ_VERSION}
SHELL ["/bin/bash", "-euxo", "pipefail", "-c"]
# hadolint ignore=DL3008
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
dirmngr \
git \
gpg \
gpg-agent \
&& rm -rf \
/tmp/* \
/var/tmp/* \
/var/lib/apt/lists/*
WORKDIR /tmp
# Simon Kelley public key can be found on https://db.debian.org/search.cgi
# hadolint ignore=DL3003
# RUN gpg --keyserver keyring.debian.org --recv-keys E19135A2 \
# && curl -OsS https://thekelleys.org.uk/dnsmasq/dnsmasq-${DNSMASQ_VERSION}.tar.gz \
# && curl -OsS https://thekelleys.org.uk/dnsmasq/dnsmasq-${DNSMASQ_VERSION}.tar.gz.asc \
# && gpg --verify dnsmasq-${DNSMASQ_VERSION}.tar.gz.asc dnsmasq-${DNSMASQ_VERSION}.tar.gz \
# && tar -xf dnsmasq-${DNSMASQ_VERSION}.tar.gz \
# && cd dnsmasq-${DNSMASQ_VERSION} \
# && make install \
# && cp dnsmasq.conf.example /tmp
# Simon Kelley public key can be found on https://db.debian.org/search.cgi
# hadolint ignore=DL3003
RUN gpg --keyserver keyring.debian.org --recv-keys E19135A2 \
&& git clone https://thekelleys.org.uk/git/dnsmasq.git \
&& cd dnsmasq \
&& git checkout tags/v${DNSMASQ_VERSION} \
# Checking the signature of the latest commit because the tags are not signed.
&& git log -n 1 --pretty=format:%G? | grep "U" \
&& make install
FROM debian:10.10-slim
SHELL ["/bin/bash", "-euxo", "pipefail", "-c"]
# hadolint ignore=DL3008
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
iputils-ping \
gosu \
&& rm -rf \
/tmp/* \
/var/tmp/* \
/var/lib/apt/lists/*
COPY --from=dnsmasq /usr/local/sbin/dnsmasq /usr/local/sbin/dnsmasq
COPY --from=dnsmasq /tmp/dnsmasq/dnsmasq.conf.example /etc/dnsmasq.conf
RUN adduser --system --no-create-home dnsmasq
WORKDIR /
COPY docker-entrypoint.sh .
RUN chmod +x docker-entrypoint.sh
EXPOSE 53/tcp
EXPOSE 53/udp
# HEALTHCHECK CMD dig cloudflare.com A +dnssec +multiline @127.0.0.1 || exit 1
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["dnsmasq", "-k"]