forked from satishweb/docker-doh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.alpine
54 lines (42 loc) · 1.54 KB
/
Dockerfile.alpine
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
# Author: Satish Gaikwad <[email protected]>
# Author: DNS.SB <[email protected]>
FROM golang:1.23-alpine AS doh-build
LABEL MAINTAINER [email protected]
RUN apk add --no-cache git make jq curl
WORKDIR /src
# Lets download latest version of DOH
RUN set -x ;\
DOH_VERSION_LATEST=v2.3.7 \
&& curl -L "https://github.com/m13253/dns-over-https/archive/${DOH_VERSION_LATEST}.zip" -o doh.zip \
&& unzip doh.zip \
&& rm doh.zip \
&& cd dns-over-https* \
&& make doh-server/doh-server \
&& mkdir /dist \
&& cp doh-server/doh-server /dist/doh-server \
&& echo ${DOH_VERSION_LATEST} > /dist/doh-server.version
FROM alpine:3.20
LABEL MAINTAINER [email protected]
COPY --from=doh-build /dist /server
COPY doh-server.sample.conf /server/doh-server.sample.conf
# Install required packages by docker-entrypoint
RUN apk add --no-cache bash gettext curl
# Add docker entrypoint and make it executable
ADD docker-entrypoint /docker-entrypoint
RUN chmod u+x /docker-entrypoint
# Change owner of the server folder
RUN chown -R nobody:nogroup /server
# Tell docker that all future commands should run as nobody
USER nobody
# Set environment defaults
# We are using DNS.SB DNS server address as default
# Here is the list of addresses: https://dns.sb/guide/
ENV UPSTREAM_DNS_SERVER="udp:185.222.222.222:53"
ENV DOH_HTTP_PREFIX="/getnsrecord"
ENV DOH_SERVER_LISTEN=":8053"
ENV DOH_SERVER_TIMEOUT="10"
ENV DOH_SERVER_TRIES="3"
ENV DOH_SERVER_VERBOSE="false"
EXPOSE 8053
ENTRYPOINT ["/docker-entrypoint"]
CMD [ "/server/doh-server", "-conf", "/server/doh-server.conf" ]