github.com/kelleygo/clashcore@v1.0.2/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 /yiclashcore-config && \
     7      wget -O /yiclashcore-config/geoip.metadb https://fastly.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geoip.metadb && \
     8      wget -O /yiclashcore-config/geosite.dat https://fastly.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geosite.dat && \
     9      wget -O /yiclashcore-config/geoip.dat https://fastly.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geoip.dat
    10  
    11  COPY docker/file-name.sh /yiclashcore/file-name.sh
    12  WORKDIR /yiclashcore
    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 yiclashcore.gz && gzip -d yiclashcore.gz && echo "$FILE_NAME" > /yiclashcore-config/test
    17  FROM alpine:latest
    18  LABEL org.opencontainers.image.source="https://github.com/kelleygo/clashcore"
    19  
    20  RUN apk add --no-cache ca-certificates tzdata iptables
    21  
    22  VOLUME ["/root/.config/yiclashcore/"]
    23  
    24  COPY --from=builder /yiclashcore-config/ /root/.config/yiclashcore/
    25  COPY --from=builder /yiclashcore/yiclashcore /yiclashcore
    26  RUN chmod +x /yiclashcore
    27  ENTRYPOINT [ "/yiclashcore" ]