From 92194ae28ead48b8b46986e841f693d350bd07f6 Mon Sep 17 00:00:00 2001 From: Samuel Huang Date: Sun, 9 Jul 2023 15:53:18 +1000 Subject: [PATCH] Unified Dockfile --- .github/workflows/docker-buildx-dev.yml | 10 ++-- .github/workflows/docker-buildx-latest.yml | 10 ++-- Dockerfile.amd64 => Dockerfile | 4 +- Dockerfile.arm | 57 ---------------------- Dockerfile.arm64 | 57 ---------------------- 5 files changed, 12 insertions(+), 126 deletions(-) rename Dockerfile.amd64 => Dockerfile (97%) delete mode 100644 Dockerfile.arm delete mode 100644 Dockerfile.arm64 diff --git a/.github/workflows/docker-buildx-dev.yml b/.github/workflows/docker-buildx-dev.yml index 1d063e6..f5cd3bf 100644 --- a/.github/workflows/docker-buildx-dev.yml +++ b/.github/workflows/docker-buildx-dev.yml @@ -41,7 +41,7 @@ jobs: uses: docker/build-push-action@v2 with: context: . - file: ./Dockerfile.amd64 + file: ./Dockerfile platforms: | linux/amd64 linux/arm64 @@ -54,7 +54,7 @@ jobs: uses: docker/build-push-action@v2 with: context: . - file: ./Dockerfile.amd64 + file: ./Dockerfile platforms: linux/amd64 push: true tags: ${{ github.repository }}:amd64dev @@ -63,7 +63,7 @@ jobs: uses: docker/build-push-action@v2 with: context: . - file: ./Dockerfile.arm64 + file: ./Dockerfile platforms: linux/arm64 push: true tags: ${{ github.repository }}:arm64dev @@ -72,7 +72,7 @@ jobs: uses: docker/build-push-action@v2 with: context: . - file: ./Dockerfile.arm + file: ./Dockerfile platforms: linux/arm/v7 push: true tags: ${{ github.repository }}:armv7dev @@ -81,7 +81,7 @@ jobs: uses: docker/build-push-action@v2 with: context: . - file: ./Dockerfile.arm + file: ./Dockerfile platforms: linux/arm/v6 push: true tags: ${{ github.repository }}:armdev diff --git a/.github/workflows/docker-buildx-latest.yml b/.github/workflows/docker-buildx-latest.yml index 7d118ef..02b4206 100644 --- a/.github/workflows/docker-buildx-latest.yml +++ b/.github/workflows/docker-buildx-latest.yml @@ -41,7 +41,7 @@ jobs: uses: docker/build-push-action@v2 with: context: . - file: ./Dockerfile.amd64 + file: ./Dockerfile platforms: | linux/amd64 linux/arm64 @@ -54,7 +54,7 @@ jobs: uses: docker/build-push-action@v2 with: context: . - file: ./Dockerfile.amd64 + file: ./Dockerfile platforms: linux/amd64 push: true tags: ${{ github.repository }}:amd64 @@ -63,7 +63,7 @@ jobs: uses: docker/build-push-action@v2 with: context: . - file: ./Dockerfile.arm64 + file: ./Dockerfile platforms: linux/arm64 push: true tags: ${{ github.repository }}:arm64 @@ -72,7 +72,7 @@ jobs: uses: docker/build-push-action@v2 with: context: . - file: ./Dockerfile.arm + file: ./Dockerfile platforms: linux/arm/v7 push: true tags: ${{ github.repository }}:armv7 @@ -81,7 +81,7 @@ jobs: uses: docker/build-push-action@v2 with: context: . - file: ./Dockerfile.arm + file: ./Dockerfile platforms: linux/arm/v6 push: true tags: ${{ github.repository }}:arm diff --git a/Dockerfile.amd64 b/Dockerfile similarity index 97% rename from Dockerfile.amd64 rename to Dockerfile index 1aedc23..c705163 100644 --- a/Dockerfile.amd64 +++ b/Dockerfile @@ -1,6 +1,6 @@ -FROM golang:1.20-alpine as builder +FROM golang:1.19-alpine as builder -ARG XRAYVER='v1.7.5' +ARG XRAYVER='v1.6.2' RUN apk add --no-cache bash git build-base wget diff --git a/Dockerfile.arm b/Dockerfile.arm deleted file mode 100644 index 0da3617..0000000 --- a/Dockerfile.arm +++ /dev/null @@ -1,57 +0,0 @@ -FROM arm32v6/golang:1.20-alpine as builder - -ARG XRAYVER='v1.7.5' - -RUN apk add --no-cache bash git build-base wget - -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/google.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 - -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 - - -FROM arm32v6/alpine:3.17 - -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 mkdir -p /etc/dnsmasq.disable - -COPY --from=builder /tmp/apple.china.conf /etc/dnsmasq.disable/ -COPY --from=builder /tmp/google.china.conf /etc/dnsmasq.disable/ -COPY --from=builder /tmp/bogus-nxdomain.china.conf /etc/dnsmasq.disable/ -COPY --from=builder /tmp/accelerated-domains.china.conf /etc/dnsmasq.disable/ - -RUN apk update && apk add bash openssl curl jq moreutils \ - whois dnsmasq ca-certificates proxychains-ng npm -RUN npm install -g qrcode-terminal --verbose - -RUN sed -i "s/^socks4.*/socks5\t127.0.0.1 1080/g" /etc/proxychains/proxychains.conf - -ADD proxy-ltx.sh /proxy-ltx.sh -ADD proxy-ltt.sh /proxy-ltt.sh -ADD proxy-ltpw.sh /proxy-ltpw.sh -ADD proxy-lttw.sh /proxy-lttw.sh -ADD proxy-ltpg.sh /proxy-ltpg.sh -ADD proxy-lttg.sh /proxy-lttg.sh -ADD proxy-mtt.sh /proxy-mtt.sh -ADD proxy-mtpw.sh /proxy-mtpw.sh -ADD proxy-mttw.sh /proxy-mttw.sh -ADD proxy-ttt.sh /proxy-ttt.sh -ADD proxy-ttpw.sh /proxy-ttpw.sh -ADD proxy-tttw.sh /proxy-tttw.sh -ADD status.sh /status.sh -ADD run.sh /run.sh - -RUN chmod 755 /*.sh - -ENTRYPOINT ["/run.sh"] diff --git a/Dockerfile.arm64 b/Dockerfile.arm64 deleted file mode 100644 index 59eafc2..0000000 --- a/Dockerfile.arm64 +++ /dev/null @@ -1,57 +0,0 @@ -FROM arm64v8/golang:1.20-alpine as builder - -ARG XRAYVER='v1.7.5' - -RUN apk add --no-cache bash git build-base wget - -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/google.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 - -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 - - -FROM arm64v8/alpine:3.17 - -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 mkdir -p /etc/dnsmasq.disable - -COPY --from=builder /tmp/apple.china.conf /etc/dnsmasq.disable/ -COPY --from=builder /tmp/google.china.conf /etc/dnsmasq.disable/ -COPY --from=builder /tmp/bogus-nxdomain.china.conf /etc/dnsmasq.disable/ -COPY --from=builder /tmp/accelerated-domains.china.conf /etc/dnsmasq.disable/ - -RUN apk update && apk add bash openssl curl jq moreutils \ - whois dnsmasq ca-certificates proxychains-ng npm -RUN npm install -g qrcode-terminal --verbose - -RUN sed -i "s/^socks4.*/socks5\t127.0.0.1 1080/g" /etc/proxychains/proxychains.conf - -ADD proxy-ltx.sh /proxy-ltx.sh -ADD proxy-ltt.sh /proxy-ltt.sh -ADD proxy-ltpw.sh /proxy-ltpw.sh -ADD proxy-lttw.sh /proxy-lttw.sh -ADD proxy-ltpg.sh /proxy-ltpg.sh -ADD proxy-lttg.sh /proxy-lttg.sh -ADD proxy-mtt.sh /proxy-mtt.sh -ADD proxy-mtpw.sh /proxy-mtpw.sh -ADD proxy-mttw.sh /proxy-mttw.sh -ADD proxy-ttt.sh /proxy-ttt.sh -ADD proxy-ttpw.sh /proxy-ttpw.sh -ADD proxy-tttw.sh /proxy-tttw.sh -ADD status.sh /status.sh -ADD run.sh /run.sh - -RUN chmod 755 /*.sh - -ENTRYPOINT ["/run.sh"]