ngbs 4 years ago
parent
commit
3abf7c0ef1
4 changed files with 33 additions and 19 deletions
  1. 2 2
      .github/workflows/main.yml
  2. 24 10
      caddy/v2/Dockerfile
  3. 4 4
      tinyfec/Dockerfile
  4. 3 3
      udp2raw/Dockerfile

+ 2 - 2
.github/workflows/main.yml

@@ -5,8 +5,8 @@ name: CI to Docker Hub
 # Controls when the workflow will run
 on:
   # Triggers the workflow on push or pull request events but only for the master branch
-  push:
-    branches: [ master ]
+  # push:
+  #   branches: [ master ]
   # pull_request:
   #   branches: [ master ]
 

+ 24 - 10
caddy/v2/Dockerfile

@@ -3,13 +3,27 @@ FROM golang:alpine AS builder
 RUN apk add --no-cach git && \
     go get -u github.com/caddyserver/xcaddy/cmd/xcaddy && \
     git clone -b naive https://github.com/klzgrad/forwardproxy && \
-    xcaddy build \
-    --with github.com/caddy-dns/cloudflare \
-    --with github.com/mastercactapus/caddy2-proxyprotocol \
-    # --with github.com/caddyserver/forwardproxy@caddy2=github.com/klzgrad/forwardproxy@naive \
-    --with github.com/caddyserver/forwardproxy=$PWD/forwardproxy \
-    --with github.com/mholt/caddy-l4 \
-    --with github.com/mholt/caddy-webdav
+    export version=$(curl -fsSL https://api.github.com/repos/caddyserver/caddy/releases/latest | grep '"tag_name":' | head -n 1 | sed -E 's/.*"([^"]+)".*/\1/') && \
+    # xcaddy build ${version} --output ./caddy_${version} \
+    xcaddy build ${version} \
+        --with github.com/abiosoft/caddy-exec \
+        --with github.com/caddy-dns/cloudflare \
+        # --with github.com/caddy-dns/dnspod \
+        # --with github.com/caddy-dns/duckdns \
+        # --with github.com/caddy-dns/gandi \
+        # --with github.com/caddy-dns/route53 \
+        # --with github.com/greenpau/caddy-auth-jwt \
+        # --with github.com/greenpau/caddy-auth-portal \
+        # --with github.com/greenpau/caddy-trace \
+        # --with github.com/hairyhenderson/caddy-teapot-module \
+        # --with github.com/kirsch33/realip \
+        # --with github.com/porech/caddy-maxmind-geolocation \
+        # --with github.com/caddyserver/format-encoder \
+        --with github.com/mastercactapus/caddy2-proxyprotocol \
+        # --with github.com/caddyserver/forwardproxy@caddy2=github.com/klzgrad/forwardproxy@naive \
+        --with github.com/caddyserver/forwardproxy=$PWD/forwardproxy \
+        --with github.com/mholt/caddy-l4 \
+        --with github.com/mholt/caddy-webdav
 
 FROM playn/alpine
 COPY --from=builder /go/caddy /usr/bin/
@@ -20,8 +34,8 @@ ENV XDG_DATA_HOME=/data
 VOLUME /config
 VOLUME /data
 
-# EXPOSE 80
-# EXPOSE 443
+EXPOSE 80
+EXPOSE 443
 # EXPOSE 2019
 
-# ENTRYPOINT ["/usr/bin/caddy"]
+ENTRYPOINT ["/usr/bin/caddy"]

+ 4 - 4
tinyfec/Dockerfile

@@ -1,11 +1,11 @@
 FROM playn/alpine as builder
-RUN apk add --no-cache git  build-base linux-headers && \
+RUN apk add --no-cache git build-base linux-headers && \
     git clone --recursive https://github.com/wangyu-/tinyfecVPN.git  && \
     cd tinyfecVPN && \
     sed -i '11s/^/#define NOLIMIT/g' tun_dev.h && \
     make nolimit
 
 FROM playn/alpine
-RUN apk add --no-cache iptables ip6tables
-COPY --from=builder /tinyfecVPN/tinyvpn /bin/tinyvpn
-ENTRYPOINT [ "/bin/tinyvpn" ]
+RUN apk add --no-cache iptables
+COPY --from=builder /tinyfecVPN/tinyvpn /usr/bin/tinyvpn
+ENTRYPOINT [ "/usr/bin/tinyvpn" ]

+ 3 - 3
udp2raw/Dockerfile

@@ -5,6 +5,6 @@ RUN apk add --no-cache git build-base linux-headers && \
     make dynamic
 
 FROM playn/alpine
-RUN apk add --no-cache libstdc++ iptables ip6tables
-COPY --from=builder /udp2raw-tunnel/udp2raw_dynamic /bin/udp2raw
-ENTRYPOINT [ "/bin/udp2raw" ]
+RUN apk add --no-cache libstdc++ iptables
+COPY --from=builder /udp2raw-tunnel/udp2raw_dynamic /usr/bin/udp2raw
+ENTRYPOINT [ "/usr/bin/udp2raw" ]