github.com/yaling888/clash@v1.53.0/Dockerfile (about) 1 FROM --platform=${BUILDPLATFORM} golang:alpine as builder 2 3 RUN apk add --no-cache make git ca-certificates && \ 4 wget -O /Country.mmdb https://raw.githubusercontent.com/yaling888/geoip/release/Country.mmdb && \ 5 wget -O /geosite.dat https://raw.githubusercontent.com/yaling888/geosite/release/geosite.dat 6 WORKDIR /workdir 7 COPY --from=tonistiigi/xx:golang / / 8 ARG TARGETOS TARGETARCH TARGETVARIANT 9 10 RUN --mount=target=. \ 11 --mount=type=cache,target=/root/.cache/go-build \ 12 --mount=type=cache,target=/go/pkg/mod \ 13 make BINDIR= ${TARGETOS}-${TARGETARCH}${TARGETVARIANT} && \ 14 mv /clash* /clash 15 16 FROM alpine:latest 17 LABEL org.opencontainers.image.source="https://github.com/yaling888/clash" 18 19 COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ 20 COPY --from=builder /Country.mmdb /root/.config/clash/ 21 COPY --from=builder /geosite.dat /root/.config/clash/ 22 COPY --from=builder /clash / 23 ENTRYPOINT ["/clash"]