github.com/metacubex/mihomo@v1.18.5/Dockerfile (about)

     1  FROM alpine:latest as builder
     2  ARG TARGETPLATFORM
     3  RUN echo "I'm building for $TARGETPLATFORM"
     4  
     5  RUN apk add --no-cache gzip && \
     6      mkdir /mihomo-config && \
     7      wget -O /mihomo-config/geoip.metadb https://fastly.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geoip.metadb && \
     8      wget -O /mihomo-config/geosite.dat https://fastly.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geosite.dat && \
     9      wget -O /mihomo-config/geoip.dat https://fastly.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geoip.dat
    10  
    11  COPY docker/file-name.sh /mihomo/file-name.sh
    12  WORKDIR /mihomo
    13  COPY bin/ bin/
    14  RUN FILE_NAME=`sh file-name.sh` && echo $FILE_NAME && \
    15      FILE_NAME=`ls bin/ | egrep "$FILE_NAME.gz"|awk NR==1` && echo $FILE_NAME && \
    16      mv bin/$FILE_NAME mihomo.gz && gzip -d mihomo.gz && echo "$FILE_NAME" > /mihomo-config/test
    17  FROM alpine:latest
    18  LABEL org.opencontainers.image.source="https://github.com/MetaCubeX/mihomo"
    19  
    20  RUN apk add --no-cache ca-certificates tzdata iptables
    21  
    22  VOLUME ["/root/.config/mihomo/"]
    23  
    24  COPY --from=builder /mihomo-config/ /root/.config/mihomo/
    25  COPY --from=builder /mihomo/mihomo /mihomo
    26  RUN chmod +x /mihomo
    27  ENTRYPOINT [ "/mihomo" ]