2020-01-28 16:39:52 +08:00
|
|
|
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 && \
|
2020-01-30 21:19:51 +08:00
|
|
|
wget -O /qemu-aarch64-static https://github.com/multiarch/qemu-user-static/releases/latest/download/qemu-aarch64-static && \
|
|
|
|
chmod +x /qemu-aarch64-static
|
2020-01-28 16:39:52 +08:00
|
|
|
|
|
|
|
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"]
|