This repository has been archived by the owner on May 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
64 lines (48 loc) · 1.84 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
# Build ZeroTier -----------------------------------------------------------------------
FROM --platform=$TARGETPLATFORM lsiodev/ubuntu:focal as zerotier
COPY ZeroTier/ /src
WORKDIR /src
RUN apt-get update -y && apt-get install -y make gcc g++
RUN make -f make-linux.mk
RUN chmod +x zerotier-one
# Build CoreDNS ------------------------------------------------------------------------
FROM --platform=$TARGETPLATFORM lsiodev/ubuntu:focal as coredns
COPY CoreDNS/ /src
WORKDIR /src
RUN apt-get update -y && apt-get install -y make golang
RUN make
RUN chmod +x coredns
# Setup ZeroDNS ------------------------------------------------------------------------
FROM --platform=$TARGETPLATFORM lsiodev/ubuntu:focal as zerodns
# set version label
ARG BUILD_DATE
ARG ZeroDNS
ARG CoreDNS
ARG ZeroTier
LABEL build_version="ZeroDNS version:- ${ZeroDNS} Build-date:- ${BUILD_DATE}"
LABEL maintainer="jmuchovej"
LABEL CoreDNS="${CoreDNS}"
LABEL ZeroDNS="${ZeroDNS}"
LABEL ZeroTier="${ZeroTier}"
# environment settings
ARG DEBIAN_FRONTEND="noninteractive"
# add local files
COPY root/ /
COPY --from=zerotier /src/zerotier-one /usr/sbin/
COPY --from=coredns /src/coredns /usr/bin/
RUN mkdir -p /var/lib/zerotier-one \
&& ln -s /usr/sbin/zerotier-one /usr/sbin/zerotier-idtool \
&& ln -s /usr/sbin/zerotier-one /usr/sbin/zerotier-cli
# add dependencies (this bloats the image quite a bit)
RUN echo "*** install apt-dependencies for ZeroDNS ***" \
&& apt-get update -y \
&& apt-get install -y ca-certificates python3 python3-pip npm nodejs iputils-ping net-tools libcap-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN echo "*** install ZeroDNS ***" \
&& pip3 install -r /app/requirements.txt \
&& npm install -g @laduke/zerotier-central-cli \
&& rm -rf /tmp/* /var/tmp/*
# ports and volumes
EXPOSE 5353 5353/udp
VOLUME /config