-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (29 loc) · 1.12 KB
/
Copy pathDockerfile
File metadata and controls
37 lines (29 loc) · 1.12 KB
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
FROM debian:stretch-slim
LABEL maintainer="Stephen Price <stephen@stp5.net>"
ENV NEXTDNS_VERSION=1.4.35 \
NEXTDNS_SHA256=b6bdfe5d5577b6abab985de5748c23e0b27d50b500b89671e09b8235f3bd6ff4
ENV NEXTDNS_ARGUMENTS="-listen :53 -report-client-info -log-queries"
ENV UID 1000
ENV GID 1000
ENV TIMEZONE UTC
RUN apt-get update \
&& apt-get install -y curl libcap2-bin
RUN mkdir /tmp/nextdns \
&& curl -fsSL https://github.com/nextdns/nextdns/releases/download/v${NEXTDNS_VERSION}/nextdns_${NEXTDNS_VERSION}_linux_amd64.tar.gz -o /tmp/nextdns/nextdns.tar.gz \
&& cd /tmp/nextdns \
&& echo "${NEXTDNS_SHA256} *nextdns.tar.gz" | sha256sum -c - \
&& tar zxf nextdns.tar.gz \
&& addgroup --gid ${GID} nextdns \
&& adduser --system --uid ${UID} --gid ${GID} --home /nextdns nextdns \
&& mv ./nextdns /nextdns/nextdns \
&& chown nextdns.nextdns /nextdns/nextdns \
&& setcap 'cap_net_bind_service=+ep' /nextdns/nextdns \
&& cd / \
&& rm -rf /tmp/nextdns \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
EXPOSE 53/tcp 53/udp
USER nextdns
ADD ./run.sh /nextdns/run.sh
WORKDIR /nextdns
CMD ["./run.sh"]