ngbs 4 jaren geleden
bovenliggende
commit
91b8a179b7
5 gewijzigde bestanden met toevoegingen van 57 en 2 verwijderingen
  1. 24 0
      .github/workflows/main.yml
  2. 1 1
      alpine/Dockerfile
  3. 1 1
      alpine/Dockerfile.edge
  4. 13 0
      chinadns-ng/Dockerfile
  5. 18 0
      dnscrypt/proxy/Dockerfile

+ 24 - 0
.github/workflows/main.yml

@@ -70,6 +70,30 @@ jobs:
           cache-from: type=local,src=/tmp/.buildx-cache
           cache-from: type=local,src=/tmp/.buildx-cache
           cache-to: type=local,dest=/tmp/.buildx-cache-new
           cache-to: type=local,dest=/tmp/.buildx-cache-new
       
       
+      - name: Build ChinaDNS-NG and push
+        id: docker_build_chinadns_ng
+        uses: docker/build-push-action@v2
+        with:
+          context: ./chinadns-ng
+          file: ./chinadns-ng/Dockerfile
+          push: true
+          tags: ${{ secrets.DOCKER_HUB_USERNAME }}/chinadns-ng:1.0-beta25
+          builder: ${{ steps.buildx.outputs.name }}
+          cache-from: type=local,src=/tmp/.buildx-cache
+          cache-to: type=local,dest=/tmp/.buildx-cache-new
+      
+      - name: Build Dnscrypt-Proxy and push
+        id: docker_build_dnscrypt_proxy
+        uses: docker/build-push-action@v2
+        with:
+          context: ./dnscrypt/proxy
+          file: ./dnscrypt/proxy/Dockerfile
+          push: true
+          tags: ${{ secrets.DOCKER_HUB_USERNAME }}/dnscrypt-proxy:2.0.46-beta3
+          builder: ${{ steps.buildx.outputs.name }}
+          cache-from: type=local,src=/tmp/.buildx-cache
+          cache-to: type=local,dest=/tmp/.buildx-cache-new
+      
       - name: Move cache
       - name: Move cache
         run: |
         run: |
           rm -rf /tmp/.buildx-cache
           rm -rf /tmp/.buildx-cache

+ 1 - 1
alpine/Dockerfile

@@ -1,6 +1,6 @@
 # syntax=docker/dockerfile:1
 # syntax=docker/dockerfile:1
 FROM alpine:latest
 FROM alpine:latest
 RUN apk add --no-cach --no-progress --virtual .build-deps tzdata && \
 RUN apk add --no-cach --no-progress --virtual .build-deps tzdata && \
-    ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
+    cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
     echo "Asia/Shanghai" > /etc/timezone && \
     echo "Asia/Shanghai" > /etc/timezone && \
     apk del .build-deps
     apk del .build-deps

+ 1 - 1
alpine/Dockerfile.edge

@@ -1,6 +1,6 @@
 # syntax=docker/dockerfile:1
 # syntax=docker/dockerfile:1
 FROM alpine:edge
 FROM alpine:edge
 RUN apk add --no-cach --no-progress --virtual .build-deps tzdata && \
 RUN apk add --no-cach --no-progress --virtual .build-deps tzdata && \
-    ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
+    cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
     echo "Asia/Shanghai" > /etc/timezone && \
     echo "Asia/Shanghai" > /etc/timezone && \
     apk del .build-deps
     apk del .build-deps

+ 13 - 0
chinadns-ng/Dockerfile

@@ -0,0 +1,13 @@
+# syntax=docker/dockerfile:1
+FROM golang:alpine AS builder
+WORKDIR /go
+RUN apk --no-cache --no-progress add git gcc make libc-dev linux-headers && \
+    git clone https://github.com/zfl9/chinadns-ng.git && \
+    cd /go/chinadns-ng && \
+    make -j$(nproc) CFLAGS="-O3 -pipe" && \
+    make install
+
+FROM playn/alpine
+COPY --from=builder /usr/local/bin/chinadns-ng /usr/local/bin/chinadns-ng
+RUN apk --no-cache --no-progress add ipset
+ENTRYPOINT [ "/usr/local/bin/chinadns-ng" ]

+ 18 - 0
dnscrypt/proxy/Dockerfile

@@ -0,0 +1,18 @@
+# syntax=docker/dockerfile:1
+FROM playn/alpine AS builder
+ARG version=2.0.46-beta3
+RUN wget -c https://github.com/DNSCrypt/dnscrypt-proxy/releases/download/${version}/dnscrypt-proxy-linux_x86_64-${version}.tar.gz && \
+    tar -zxf dnscrypt-proxy-linux_x86_64-${version}.tar.gz -C /tmp && \
+    mv /tmp/linux-x86_64/example-allowed-ips.txt /tmp/linux-x86_64/allowed-ips.txt && \
+    mv /tmp/linux-x86_64/example-allowed-names.txt /tmp/linux-x86_64/allowed-names.txt && \
+    mv /tmp/linux-x86_64/example-blocked-ips.txt /tmp/linux-x86_64/blocked-ips.txt && \
+    mv /tmp/linux-x86_64/example-blocked-names.txt /tmp/linux-x86_64/blocked-names.txt && \
+    mv /tmp/linux-x86_64/example-captive-portals.txt /tmp/linux-x86_64/captive-portals.txt && \
+    mv /tmp/linux-x86_64/example-cloaking-rules.txt /tmp/linux-x86_64/cloaking-rules.txt && \
+    mv /tmp/linux-x86_64/example-forwarding-rules.txt /tmp/linux-x86_64/forwarding-rules.txt && \
+    mv /tmp/linux-x86_64/example-dnscrypt-proxy.toml /tmp/linux-x86_64/dnscrypt-proxy.toml && \
+    mv /tmp/linux-x86_64 /usr/local/bin/dnscrypt-proxy
+
+FROM playn/alpine
+COPY --from=builder /usr/local/bin/dnscrypt-proxy /usr/local/bin/dnscrypt-proxy
+ENTRYPOINT [ "/usr/local/bin/dnscrypt-proxy/dnscrypt-proxy" ]