|
@ -11,51 +11,44 @@ RUN make -C ./src/ && mkdir -p /upx/bin/ && mv ./src/upx.out /upx/bin/upx && \ |
|
|
|
|
|
|
|
|
FROM ${GOLANG_IMG} AS adguardhome |
|
|
FROM ${GOLANG_IMG} AS adguardhome |
|
|
ENV ADGUARD_VER="v0.107.12" |
|
|
ENV ADGUARD_VER="v0.107.12" |
|
|
RUN apk add git make npm yarn |
|
|
RUN apk add git make npm yarn && git clone https://github.com/AdguardTeam/AdGuardHome.git |
|
|
RUN git clone https://github.com/AdguardTeam/AdGuardHome.git |
|
|
|
|
|
WORKDIR ./AdGuardHome/ |
|
|
WORKDIR ./AdGuardHome/ |
|
|
RUN git checkout ${ADGUARD_VER} && make CHANNEL="release" VERSION=${ADGUARD_VER} && mv ./AdGuardHome /tmp/ |
|
|
RUN git checkout ${ADGUARD_VER} && make js-deps |
|
|
|
|
|
RUN make js-build |
|
|
|
|
|
RUN make CHANNEL="release" VERSION=${ADGUARD_VER} VERBOSE=1 go-build && mv ./AdGuardHome /tmp/ |
|
|
|
|
|
|
|
|
FROM ${GOLANG_IMG} AS dnsproxy |
|
|
FROM ${GOLANG_IMG} AS dnsproxy |
|
|
ENV DNSPROXY_VER="0.44.0" |
|
|
ENV DNSPROXY_VER="0.44.0" |
|
|
RUN wget https://github.com/AdguardTeam/dnsproxy/archive/refs/tags/v${DNSPROXY_VER}.tar.gz && tar xf v${DNSPROXY_VER}.tar.gz |
|
|
RUN wget https://github.com/AdguardTeam/dnsproxy/archive/refs/tags/v${DNSPROXY_VER}.tar.gz && tar xf v${DNSPROXY_VER}.tar.gz |
|
|
WORKDIR ./dnsproxy-${DNSPROXY_VER}/ |
|
|
WORKDIR ./dnsproxy-${DNSPROXY_VER}/ |
|
|
RUN go mod download -x |
|
|
|
|
|
RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-X main.VersionString=${DNSPROXY_VER} -s -w" && mv ./dnsproxy /tmp/ |
|
|
RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-X main.VersionString=${DNSPROXY_VER} -s -w" && mv ./dnsproxy /tmp/ |
|
|
|
|
|
|
|
|
FROM ${GOLANG_IMG} AS overture |
|
|
FROM ${GOLANG_IMG} AS overture |
|
|
ENV OVERTURE_VER="1.8" |
|
|
ENV OVERTURE_VER="1.8" |
|
|
RUN wget https://github.com/shawn1m/overture/archive/refs/tags/v${OVERTURE_VER}.tar.gz && tar xf ./v${OVERTURE_VER}.tar.gz |
|
|
RUN wget https://github.com/shawn1m/overture/archive/refs/tags/v${OVERTURE_VER}.tar.gz && tar xf ./v${OVERTURE_VER}.tar.gz |
|
|
WORKDIR ./overture-${OVERTURE_VER}/ |
|
|
WORKDIR ./overture-${OVERTURE_VER}/main/ |
|
|
RUN env CGO_ENABLED=0 go build -o overture -trimpath -ldflags "-X main.version=v${OVERTURE_VER} -s -w" ./main/main.go && mv ./overture /tmp/ |
|
|
RUN env CGO_ENABLED=0 go build -o overture -trimpath -ldflags "-X main.version=v${OVERTURE_VER} -s -w" ./main.go && mv ./overture /tmp/ |
|
|
|
|
|
|
|
|
FROM ${ALPINE_IMG} AS cleardns |
|
|
#FROM ${ALPINE_IMG} AS cleardns |
|
|
COPY . /ClearDNS |
|
|
#COPY . /ClearDNS |
|
|
RUN apk add build-base cmake glib-dev |
|
|
#RUN apk add build-base cmake glib-dev |
|
|
RUN cd ./ClearDNS/ && mkdir ./build/ && \ |
|
|
#RUN cd ./ClearDNS/ && mkdir ./build/ && \ |
|
|
cd ./build/ && cmake -DCMAKE_BUILD_TYPE=Release .. && make && \ |
|
|
# cd ./build/ && cmake -DCMAKE_BUILD_TYPE=Release .. && make && \ |
|
|
mv ../bin/cleardns /tmp/ && strip /tmp/cleardns |
|
|
# mv ../bin/cleardns /tmp/ && strip /tmp/cleardns |
|
|
|
|
|
|
|
|
FROM ${ALPINE_IMG} AS asset |
|
|
FROM ${ALPINE_IMG} AS asset |
|
|
RUN apk add xz && \ |
|
|
RUN apk add xz && mkdir -p /asset/ && \ |
|
|
wget https://res.dnomd343.top/Share/gfwlist/gfwlist.txt && \ |
|
|
wget https://res.dnomd343.top/Share/gfwlist/gfwlist.txt && \ |
|
|
wget https://res.dnomd343.top/Share/chinalist/china-ip.txt && \ |
|
|
wget https://res.dnomd343.top/Share/chinalist/china-ip.txt && \ |
|
|
wget https://res.dnomd343.top/Share/chinalist/chinalist.txt && \ |
|
|
wget https://res.dnomd343.top/Share/chinalist/chinalist.txt && \ |
|
|
tar cJf /tmp/assets.tar.xz ./gfwlist.txt ./china-ip.txt ./chinalist.txt |
|
|
tar cJf /asset/assets.tar.xz ./*.txt |
|
|
COPY --from=dnsproxy /tmp/dnsproxy /asset/usr/bin/ |
|
|
COPY --from=dnsproxy /tmp/dnsproxy /asset/usr/bin/ |
|
|
COPY --from=overture /tmp/overture /asset/usr/bin/ |
|
|
COPY --from=overture /tmp/overture /asset/usr/bin/ |
|
|
COPY --from=adguardhome /tmp/AdGuardHome /asset/usr/bin/ |
|
|
COPY --from=adguardhome /tmp/AdGuardHome /asset/usr/bin/ |
|
|
COPY --from=upx /upx/ /usr/ |
|
|
COPY --from=upx /upx/ /usr/ |
|
|
RUN ls /asset/usr/bin/* | xargs -P0 -n1 upx -9 |
|
|
RUN ls /asset/usr/bin/* | xargs -P0 -n1 upx -9 |
|
|
COPY --from=cleardns /tmp/cleardns /asset/usr/bin/ |
|
|
#COPY --from=cleardns /tmp/cleardns /asset/usr/bin/ |
|
|
COPY . /ClearDNS |
|
|
|
|
|
RUN mkdir -p /asset/etc/ && \ |
|
|
|
|
|
cp -r /ClearDNS/overture/ /asset/etc/ && \ |
|
|
|
|
|
mv /tmp/assets.tar.xz /asset/etc/overture/asset.tar.xz && \ |
|
|
|
|
|
mv /ClearDNS/load.sh /asset/usr/bin/load |
|
|
|
|
|
|
|
|
|
|
|
FROM ${ALPINE_IMG} |
|
|
FROM ${ALPINE_IMG} |
|
|
COPY --from=asset /asset / |
|
|
COPY --from=asset /asset/ / |
|
|
RUN #apk add --no-cache ca-certificates glib && \ |
|
|
|
|
|
#echo -e "0\t4\t*\t*\t*\t/etc/overture/update.sh" > /var/spool/cron/crontabs/root |
|
|
|
|
|
#ENTRYPOINT ["cleardns"] |
|
|
#ENTRYPOINT ["cleardns"] |
|
|