From 0dfd5e5beefded4068749bbcbe52095c1669a36c Mon Sep 17 00:00:00 2001 From: Samuel Huang Date: Sat, 28 Aug 2021 02:13:40 +1000 Subject: [PATCH] wget download to avoid temporary network issue --- Dockerfile.amd64 | 22 ++++++++++++++-------- Dockerfile.arm | 22 ++++++++++++++-------- Dockerfile.arm64 | 22 ++++++++++++++-------- 3 files changed, 42 insertions(+), 24 deletions(-) diff --git a/Dockerfile.amd64 b/Dockerfile.amd64 index 7a942fd..eb235bf 100644 --- a/Dockerfile.amd64 +++ b/Dockerfile.amd64 @@ -2,31 +2,37 @@ FROM golang:1.16-alpine as builder ARG XRAYVER='v1.4.2' -RUN apk add --no-cache bash git build-base +RUN apk add --no-cache bash git build-base wget WORKDIR /go/src/XTLS/Xray-core RUN git clone https://github.com/XTLS/Xray-core.git . && \ git checkout ${XRAYVER} && \ go build -o xray -trimpath -ldflags "-s -w -buildid=" ./main +RUN cd /tmp; wget -c -t3 -T30 https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat +RUN cd /tmp; wget -c -t3 -T30 https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat + +RUN cd /tmp; wget -c -t3 -T30 https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/apple.china.conf +RUN cd /tmp; wget -c -t3 -T30 https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/bogus-nxdomain.china.conf +RUN cd /tmp; wget -c -t3 -T30 https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/accelerated-domains.china.conf FROM alpine:3.14 COPY --from=builder /go/src/XTLS/Xray-core/xray /usr/local/bin/ +COPY --from=builder /tmp/geosite.dat /usr/local/bin/ +COPY --from=builder /tmp/geoip.dat /usr/local/bin/ -RUN cd /usr/local/bin; curl -sSLO https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat -RUN cd /usr/local/bin; curl -sSLO https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat +RUN mkdir -p /etc/dnsmasq-china.d + +COPY --from=builder /tmp/apple.china.conf /etc/dnsmasq-china.d/ +COPY --from=builder /tmp/bogus-nxdomain.china.conf /etc/dnsmasq-china.d/ +COPY --from=builder /tmp/accelerated-domains.china.conf /etc/dnsmasq-china.d/ RUN apk update && apk add bash openssl curl jq moreutils \ bind-tools whois dnsmasq ca-certificates proxychains-ng npm RUN npm config set unsafe-perm true RUN npm install -g qrcode-terminal -RUN mkdir -p /etc/dnsmasq-china.d -RUN cd /etc/dnsmasq-china.d; curl -sSLO https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/bogus-nxdomain.china.conf -RUN cd /etc/dnsmasq-china.d; curl -sSLO https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/bogus-nxdomain.china.conf -RUN cd /etc/dnsmasq-china.d; curl -sSLO https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/apple.china.conf - ENV DNSPORT="53" RUN sed -i "s/^socks4.*/socks5\t127.0.0.1 1080/g" /etc/proxychains/proxychains.conf diff --git a/Dockerfile.arm b/Dockerfile.arm index 54a9e65..a8a5b41 100644 --- a/Dockerfile.arm +++ b/Dockerfile.arm @@ -2,31 +2,37 @@ FROM arm32v6/golang:1.16-alpine as builder ARG XRAYVER='v1.4.2' -RUN apk add --no-cache bash git build-base +RUN apk add --no-cache bash git build-base wget WORKDIR /go/src/XTLS/Xray-core RUN git clone https://github.com/XTLS/Xray-core.git . && \ git checkout ${XRAYVER} && \ go build -o xray -trimpath -ldflags "-s -w -buildid=" ./main +RUN cd /tmp; wget -c -t3 -T30 https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat +RUN cd /tmp; wget -c -t3 -T30 https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat + +RUN cd /tmp; wget -c -t3 -T30 https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/apple.china.conf +RUN cd /tmp; wget -c -t3 -T30 https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/bogus-nxdomain.china.conf +RUN cd /tmp; wget -c -t3 -T30 https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/accelerated-domains.china.conf FROM arm32v6/alpine:3.14 COPY --from=builder /go/src/XTLS/Xray-core/xray /usr/local/bin/ +COPY --from=builder /tmp/geosite.dat /usr/local/bin/ +COPY --from=builder /tmp/geoip.dat /usr/local/bin/ -RUN cd /usr/local/bin; curl -sSLO https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat -RUN cd /usr/local/bin; curl -sSLO https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat +RUN mkdir -p /etc/dnsmasq-china.d + +COPY --from=builder /tmp/apple.china.conf /etc/dnsmasq-china.d/ +COPY --from=builder /tmp/bogus-nxdomain.china.conf /etc/dnsmasq-china.d/ +COPY --from=builder /tmp/accelerated-domains.china.conf /etc/dnsmasq-china.d/ RUN apk update && apk add bash openssl curl jq moreutils \ bind-tools whois dnsmasq ca-certificates proxychains-ng npm RUN npm config set unsafe-perm true RUN npm install -g qrcode-terminal -RUN mkdir -p /etc/dnsmasq-china.d -RUN cd /etc/dnsmasq-china.d; curl -sSLO https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/bogus-nxdomain.china.conf -RUN cd /etc/dnsmasq-china.d; curl -sSLO https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/bogus-nxdomain.china.conf -RUN cd /etc/dnsmasq-china.d; curl -sSLO https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/apple.china.conf - ENV DNSPORT="53" RUN sed -i "s/^socks4.*/socks5\t127.0.0.1 1080/g" /etc/proxychains/proxychains.conf diff --git a/Dockerfile.arm64 b/Dockerfile.arm64 index 6f7ea49..33feb8a 100644 --- a/Dockerfile.arm64 +++ b/Dockerfile.arm64 @@ -2,31 +2,37 @@ FROM arm64v8/golang:1.16-alpine as builder ARG XRAYVER='v1.4.2' -RUN apk add --no-cache bash git build-base +RUN apk add --no-cache bash git build-base wget WORKDIR /go/src/XTLS/Xray-core RUN git clone https://github.com/XTLS/Xray-core.git . && \ git checkout ${XRAYVER} && \ go build -o xray -trimpath -ldflags "-s -w -buildid=" ./main +RUN cd /tmp; wget -c -t3 -T30 https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat +RUN cd /tmp; wget -c -t3 -T30 https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat + +RUN cd /tmp; wget -c -t3 -T30 https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/apple.china.conf +RUN cd /tmp; wget -c -t3 -T30 https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/bogus-nxdomain.china.conf +RUN cd /tmp; wget -c -t3 -T30 https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/accelerated-domains.china.conf FROM arm64v8/alpine:3.14 COPY --from=builder /go/src/XTLS/Xray-core/xray /usr/local/bin/ +COPY --from=builder /tmp/geosite.dat /usr/local/bin/ +COPY --from=builder /tmp/geoip.dat /usr/local/bin/ -RUN cd /usr/local/bin; curl -sSLO https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat -RUN cd /usr/local/bin; curl -sSLO https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat +RUN mkdir -p /etc/dnsmasq-china.d + +COPY --from=builder /tmp/apple.china.conf /etc/dnsmasq-china.d/ +COPY --from=builder /tmp/bogus-nxdomain.china.conf /etc/dnsmasq-china.d/ +COPY --from=builder /tmp/accelerated-domains.china.conf /etc/dnsmasq-china.d/ RUN apk update && apk add bash openssl curl jq moreutils \ bind-tools whois dnsmasq ca-certificates proxychains-ng npm RUN npm config set unsafe-perm true RUN npm install -g qrcode-terminal -RUN mkdir -p /etc/dnsmasq-china.d -RUN cd /etc/dnsmasq-china.d; curl -sSLO https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/bogus-nxdomain.china.conf -RUN cd /etc/dnsmasq-china.d; curl -sSLO https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/bogus-nxdomain.china.conf -RUN cd /etc/dnsmasq-china.d; curl -sSLO https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/apple.china.conf - ENV DNSPORT="53" RUN sed -i "s/^socks4.*/socks5\t127.0.0.1 1080/g" /etc/proxychains/proxychains.conf