ngbs 4 月之前
父节点
当前提交
cdf098c5d3
共有 1 个文件被更改,包括 8 次插入4 次删除
  1. 8 4
      chinadns-ng/Dockerfile

+ 8 - 4
chinadns-ng/Dockerfile

@@ -3,7 +3,8 @@ FROM alpine:latest AS builder
 RUN apk add --no-cache \
     git \
     xz \
-    wget
+    wget \
+    make
 RUN wget https://ziglang.org/download/0.10.1/zig-linux-x86_64-0.10.1.tar.xz && \
     tar xvf zig-linux-x86_64-0.10.1.tar.xz && \
     mv zig-linux-x86_64-0.10.1 /zig && \
@@ -11,9 +12,12 @@ RUN wget https://ziglang.org/download/0.10.1/zig-linux-x86_64-0.10.1.tar.xz && \
 ENV PATH="/zig:${PATH}"
 RUN git clone https://github.com/zfl9/chinadns-ng && \
     cd chinadns-ng && \
-    zig build -Dtarget=x86_64-linux-musl -Dcpu=x86_64_v3
+    zig build -Dtarget=x86_64-linux-musl -Dcpu=x86_64 && \
+    mkdir -p /output && \
+    cp zig-out/bin/chinadns-ng /output/
 
-FROM playn/alpine:latest
-COPY --from=builder /chinadns-ng/zig-out/bin/chinadns-ng /usr/local/bin/
+FROM alpine:latest
+COPY --from=builder /output/chinadns-ng /usr/local/bin/
 RUN apk --no-cache --no-progress add ipset nftables
+RUN chinadns-ng --version
 ENTRYPOINT ["/usr/local/bin/chinadns-ng"]