From 14fb78900239eff5d6c68612d548cb4801a6caca Mon Sep 17 00:00:00 2001 From: Dreamacro <305009791@qq.com> Date: Tue, 28 Jan 2020 16:39:52 +0800 Subject: [PATCH] Feature: add arm32 and arm64 docker image --- Dockerfile.arm32v7 | 19 +++++++++++++++++++ Dockerfile.arm64v8 | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 Dockerfile.arm32v7 create mode 100644 Dockerfile.arm64v8 diff --git a/Dockerfile.arm32v7 b/Dockerfile.arm32v7 new file mode 100644 index 00000000..2d43fa46 --- /dev/null +++ b/Dockerfile.arm32v7 @@ -0,0 +1,19 @@ +FROM golang:alpine as builder + +RUN apk add --no-cache make git && \ + wget -O /Country.mmdb https://github.com/Dreamacro/maxmind-geoip/releases/latest/download/Country.mmdb && \ + wget -O /qemu-arm-static https://github.com/multiarch/qemu-user-static/releases/latest/download/qemu-arm-static + +WORKDIR /clash-src +COPY . /clash-src +RUN go mod download && \ + make linux-armv7 && \ + mv ./bin/clash-linux-armv7 /clash + +FROM arm32v7/alpine:latest + +COPY --from=builder /qemu-arm-static /usr/bin/ +COPY --from=builder /Country.mmdb /root/.config/clash/ +COPY --from=builder /clash / +RUN apk add --no-cache ca-certificates +ENTRYPOINT ["/clash"] diff --git a/Dockerfile.arm64v8 b/Dockerfile.arm64v8 new file mode 100644 index 00000000..0debda04 --- /dev/null +++ b/Dockerfile.arm64v8 @@ -0,0 +1,19 @@ +FROM golang:alpine as builder + +RUN apk add --no-cache make git && \ + wget -O /Country.mmdb https://github.com/Dreamacro/maxmind-geoip/releases/latest/download/Country.mmdb && \ + wget -O /qemu-aarch64-static https://github.com/multiarch/qemu-user-static/releases/latest/download/qemu-aarch64-static + +WORKDIR /clash-src +COPY . /clash-src +RUN go mod download && \ + make linux-armv8 && \ + mv ./bin/clash-linux-armv8 /clash + +FROM arm64v8/alpine:latest + +COPY --from=builder /qemu-aarch64-static /usr/bin/ +COPY --from=builder /Country.mmdb /root/.config/clash/ +COPY --from=builder /clash / +RUN apk add --no-cache ca-certificates +ENTRYPOINT ["/clash"]