ngbs пре 4 година
родитељ
комит
d228deda48

+ 1 - 1
caddy/v2/Dockerfile

@@ -2,7 +2,7 @@
 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 && \
+    git clone --depth 1 -b naive https://github.com/klzgrad/forwardproxy && \
     export version=$(wget -qO- 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} \

+ 1 - 1
caddy/v2/Dockerfile.lxhao61

@@ -5,7 +5,7 @@ RUN export version=$(wget -qO- https://api.github.com/repos/lxhao61/integrated-e
     tar x -z -f /tmp/caddy.tar.gz -C /usr/bin caddy; \
     rm -f /tmp/caddy.tar.gz; \
     chmod +x /usr/bin/caddy; \
-    caddy version
+    unset version
 ENV XDG_CONFIG_HOME=/config
 ENV XDG_DATA_HOME=/data
 VOLUME /config

+ 1 - 1
chinadns-ng/Dockerfile

@@ -2,7 +2,7 @@
 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 && \
+    git clone --depth 1 https://github.com/zfl9/chinadns-ng.git && \
     cd /go/chinadns-ng && \
     make -j$(nproc) CFLAGS="-O3 -pipe" && \
     make install

+ 3 - 3
doh-server/Dockerfile.client

@@ -2,11 +2,11 @@
 FROM golang:alpine AS builder
 WORKDIR /go
 RUN apk --no-cache --no-progress add git make && \
-    git clone https://github.com/m13253/dns-over-https.git && \
+    git clone --depth 1 https://github.com/m13253/dns-over-https.git && \
     cd /go/dns-over-https && \
     make doh-client/doh-client
 
 FROM playn/alpine
-COPY --from=builder /go/dns-over-https/doh-client/doh-client /doh-client
-ENTRYPOINT ["/doh-client"]
+COPY --from=builder /go/dns-over-https/doh-client/doh-client /usr/local/bin/doh-client
+ENTRYPOINT ["/usr/local/bin/doh-client"]
 CMD ["-conf", "/doh-client.conf"]

+ 3 - 3
doh-server/Dockerfile.server

@@ -2,11 +2,11 @@
 FROM golang:alpine AS builder
 WORKDIR /go
 RUN apk --no-cache --no-progress add git make && \
-    git clone https://github.com/m13253/dns-over-https.git && \
+    git clone --depth 1 https://github.com/m13253/dns-over-https.git && \
     cd /go/dns-over-https && \
     make doh-server/doh-server
 
 FROM playn/alpine
-COPY --from=builder /go/dns-over-https/doh-server/doh-server /doh-server
-ENTRYPOINT ["/doh-server"]
+COPY --from=builder /go/dns-over-https/doh-server/doh-server /usr/local/bin/doh-server
+ENTRYPOINT ["/usr/local/bin/doh-server"]
 CMD ["-conf", "/doh-server.conf"]

+ 5 - 3
frp/Dockerfile.client

@@ -1,8 +1,10 @@
 # syntax=docker/dockerfile:1
 FROM playn/alpine
-ARG version=0.37.0
-RUN wget https://github.com/fatedier/frp/releases/download/v${version}/frp_${version}_linux_amd64.tar.gz && \
+# ARG version=0.37.0
+RUN export version=$(wget -qO- https://api.github.com/repos/fatedier/frp/releases/latest | grep '"tag_name":' | head -n 1 | sed -E 's/.*"([^"]+)".*/\1/') && \
+    wget -c https://github.com/fatedier/frp/releases/download/v${version}/frp_${version}_linux_amd64.tar.gz && \
     tar zxf frp_${version}_linux_amd64.tar.gz -C /tmp && \
     mv /tmp/frp_${version}_linux_amd64/frpc /usr/local/bin && \
-    rm -rf frp_${version}_linux_amd64.tar.gz /tmp/*
+    rm -rf frp_${version}_linux_amd64.tar.gz /tmp/* && \
+    unset version
 ENTRYPOINT [ "/usr/local/bin/frpc" ]

+ 5 - 3
frp/Dockerfile.server

@@ -1,8 +1,10 @@
 # syntax=docker/dockerfile:1
 FROM playn/alpine
-ARG version=0.37.0
-RUN wget https://github.com/fatedier/frp/releases/download/v${version}/frp_${version}_linux_amd64.tar.gz && \
+# ARG version=0.37.0
+RUN export version=$(wget -qO- https://api.github.com/repos/fatedier/frp/releases/latest | grep '"tag_name":' | head -n 1 | sed -E 's/.*"([^"]+)".*/\1/') && \
+    wget -c https://github.com/fatedier/frp/releases/download/v${version}/frp_${version}_linux_amd64.tar.gz && \
     tar zxf frp_${version}_linux_amd64.tar.gz -C /tmp && \
     mv /tmp/frp_${version}_linux_amd64/frps /usr/local/bin && \
-    rm -rf frp_${version}_linux_amd64.tar.gz /tmp/*
+    rm -rf frp_${version}_linux_amd64.tar.gz /tmp/* && \
+    unset version
 ENTRYPOINT [ "/usr/local/bin/frps" ]

+ 7 - 5
kcptun/Dockerfile.client

@@ -1,8 +1,10 @@
 # syntax=docker/dockerfile:1
 FROM playn/alpine
-ARG version=20210624
-RUN wget https://github.com/xtaci/kcptun/releases/download/v${version}/kcptun-linux-amd64-${version}.tar.gz && \
+# ARG version=20210624
+RUN export version=$(wget -qO- https://api.github.com/repos/xtaci/kcptun/releases/latest | grep '"tag_name":' | head -n 1 | sed -E 's/.*"([^"]+)".*/\1/') && \
+    wget -c https://github.com/xtaci/kcptun/releases/download/v${version}/kcptun-linux-amd64-${version}.tar.gz && \
     tar zxf kcptun-linux-amd64-${version}.tar.gz -C /tmp && \
-    mv /tmp/client_linux_amd64 /usr/bin/kcptun_client && \
-    rm -rf kcptun-linux-amd64-${version}.tar.gz /tmp/*
-ENTRYPOINT ["/usr/bin/kcptun_client"]
+    mv /tmp/client_linux_amd64 /usr/local/bin/kcptun_client && \
+    rm -rf kcptun-linux-amd64-${version}.tar.gz /tmp/* && \
+    unset version
+ENTRYPOINT ["/usr/local/bin/kcptun_client"]

+ 7 - 5
kcptun/Dockerfile.server

@@ -1,8 +1,10 @@
 # syntax=docker/dockerfile:1
 FROM playn/alpine
-ARG version=20210624
-RUN wget https://github.com/xtaci/kcptun/releases/download/v${version}/kcptun-linux-amd64-${version}.tar.gz && \
+# ARG version=20210624
+RUN export version=$(wget -qO- https://api.github.com/repos/xtaci/kcptun/releases/latest | grep '"tag_name":' | head -n 1 | sed -E 's/.*"([^"]+)".*/\1/') && \
+    wget -c https://github.com/xtaci/kcptun/releases/download/v${version}/kcptun-linux-amd64-${version}.tar.gz && \
     tar zxf kcptun-linux-amd64-${version}.tar.gz -C /tmp && \
-    mv /tmp/server_linux_amd64 /usr/bin/kcptun_server && \
-    rm -rf kcptun-linux-amd64-${version}.tar.gz /tmp/*
-ENTRYPOINT ["/usr/bin/kcptun_server"]
+    mv /tmp/server_linux_amd64 /usr/local/bin/kcptun_server && \
+    rm -rf kcptun-linux-amd64-${version}.tar.gz /tmp/* && \
+    unset version
+ENTRYPOINT ["/usr/local/bin/kcptun_server"]

+ 4 - 4
kms/Dockerfile

@@ -1,10 +1,10 @@
 FROM alpine:latest as builder
 RUN apk add --no-cache git make build-base && \
-    git clone --branch master --single-branch https://github.com/Wind4/vlmcsd.git && \
-    cd vlmcsd/ && \
+    git clone --depth 1 --branch master --single-branch https://github.com/Wind4/vlmcsd.git && \
+    cd vlmcsd && \
     make
 
 FROM playn/alpine
-COPY --from=builder /vlmcsd/bin/vlmcsd /usr/bin/vlmcsd
+COPY --from=builder /vlmcsd/bin/vlmcsd /usr/local/bin/vlmcsd
 EXPOSE 1688/tcp
-CMD [ "/usr/bin/vlmcsd", "-D", "-d" ]
+CMD [ "/usr/local/bin/vlmcsd", "-D", "-d" ]

+ 7 - 5
lego/Dockerfile

@@ -1,7 +1,9 @@
 FROM playn/alpine
-ARG version=4.4.0
-RUN wget https://github.com/go-acme/lego/releases/download/v${version}/lego_v${version}_linux_amd64.tar.gz -P /tmp && \
+# ARG version=4.4.0
+RUN export version=$(wget -qO- https://api.github.com/repos/go-acme/lego/releases/latest | grep '"tag_name":' | head -n 1 | sed -E 's/.*"([^"]+)".*/\1/') && \
+    wget -c https://github.com/go-acme/lego/releases/download/v${version}/lego_v${version}_linux_amd64.tar.gz -P /tmp && \
     tar zxf /tmp/lego_v${version}_linux_amd64.tar.gz -C /tmp && \
-    mv /tmp/lego /usr/bin/lego && \
-    rm -rf /tmp/*
-ENTRYPOINT ["/usr/bin/lego"]
+    mv /tmp/lego /usr/local/bin/lego && \
+    rm -rf /tmp/* && \
+    unset version
+ENTRYPOINT ["/usr/local/bin/lego"]

+ 3 - 3
lego/Dockerfile.builder

@@ -2,11 +2,11 @@ FROM golang:alpine AS builder
 WORKDIR /go
 ENV GO111MODULE on
 RUN apk --no-cache --no-progress add make git && \
-    git clone https://github.com/go-acme/lego.git && \
+    git clone --depth 1 https://github.com/go-acme/lego.git && \
     cd /go/lego && make build
 
 FROM playn/alpine
 RUN apk add --no-cache ca-certificates && \
     update-ca-certificates
-COPY --from=builder /go/lego/dist/lego /usr/bin/lego
-ENTRYPOINT [ "/usr/bin/lego" ]
+COPY --from=builder /go/lego/dist/lego /usr/local/bin/lego
+ENTRYPOINT [ "/usr/local/bin/lego" ]

+ 10 - 7
naive/Dockerfile

@@ -1,9 +1,12 @@
 FROM playn/alpine
-ARG VERSION=v91.0.4472.77-1
-RUN apk add --no-cach gcc && \
-    wget https://github.com/klzgrad/naiveproxy/releases/download/${VERSION}/naiveproxy-${VERSION}-openwrt-x86_64.tar.xz && \
-    tar xJvf naiveproxy-${VERSION}-openwrt-x86_64.tar.xz && \
-    mv naiveproxy-${VERSION}-openwrt-x86_64/naive /usr/bin && \
-    rm -rf naiveproxy-*
-ENTRYPOINT ["/usr/bin/naive"]
+# ARG version=v91.0.4472.77-1
+RUN apk add --no-cach gcc libstdc++ && \
+    export version=$(wget -qO- https://api.github.com/repos/klzgrad/naiveproxy/releases/latest | grep '"tag_name":' | head -n 1 | sed -E 's/.*"([^"]+)".*/\1/') && \
+    wget -c https://github.com/klzgrad/naiveproxy/releases/download/${version}/naiveproxy-${version}-openwrt-x86_64.tar.xz && \
+    tar xJvf naiveproxy-${version}-openwrt-x86_64.tar.xz && \
+    mv naiveproxy-${version}-openwrt-x86_64/naive /usr/local/bin && \
+    rm -rf naiveproxy-* && \
+    apk del --purge gcc && \
+    unset version
+ENTRYPOINT ["/usr/local/bin/naive"]
 CMD ["/etc/naive/config.json"]

+ 3 - 9
samba/Dockerfile

@@ -54,13 +54,7 @@ RUN apk --no-cache --no-progress upgrade && \
     rm -rf /tmp/*
 
 COPY samba.sh /usr/bin/
-
 EXPOSE 137/udp 138/udp 139 445
-
-HEALTHCHECK --interval=60s --timeout=15s \
-            CMD smbclient -L \\localhost -U % -m SMB3
-
-VOLUME ["/etc", "/var/cache/samba", "/var/lib/samba", "/var/log/samba",\
-            "/run/samba"]
-
-ENTRYPOINT ["/sbin/tini", "--", "/usr/bin/samba.sh"]
+# HEALTHCHECK --interval=60s --timeout=15s CMD smbclient -L \\localhost -U % -m SMB3
+VOLUME ["/etc", "/var/cache/samba", "/var/lib/samba", "/var/log/samba", "/run/samba"]
+ENTRYPOINT ["/sbin/tini", "--", "/usr/bin/samba.sh"]

+ 4 - 8
syncthing/Dockerfile

@@ -1,29 +1,25 @@
 FROM golang:alpine AS builder
-
-ARG SYNCTHING_RELEASE=v1.18.0
+# ARG SYNCTHING_RELEASE=v1.18.0
 ENV CGO_ENABLED=0
 ENV BUILD_HOST=syncthing.net
 ENV BUILD_USER=docker
 RUN apk add curl && \
+    export SYNCTHING_RELEASE=$(curl -fsSL "https://api.github.com/repos/syncthing/syncthing/releases/latest" | grep '"tag_name":' | head -n 1 | sed -E 's/.*"([^"]+)".*/\1/') && \
     mkdir -p /tmp/src && \
     curl -o /tmp/syncthing-src.tar.gz -L "https://github.com/syncthing/syncthing/archive/${SYNCTHING_RELEASE}.tar.gz" && \
     tar xf /tmp/syncthing-src.tar.gz -C /tmp/src --strip-components=1 && \
     cd /tmp/src && \
-    rm -f syncthing && go run build.go -no-upgrade -version=${SYNCTHING_RELEASE} build syncthing
+    rm -f syncthing && go run build.go -no-upgrade -version=${SYNCTHING_RELEASE} build syncthing && \
+    unset SYNCTHING_RELEASE
 
 FROM playn/alpine
-
 ENV PUID=1000 PGID=1000 HOME=/var/syncthing
 RUN apk add --no-cache ca-certificates su-exec
-
 COPY --from=builder /tmp/src/syncthing /bin/syncthing
 COPY --from=builder /tmp/src/script/docker-entrypoint.sh /bin/entrypoint.sh
-
 # EXPOSE 8384 22000 21027/udp
 VOLUME ["/var/syncthing"]
-
 # HEALTHCHECK --interval=1m --timeout=10s \
 # CMD nc -z 127.0.0.1 8384 || exit 1
-
 ENV STGUIADDRESS=0.0.0.0:8384
 ENTRYPOINT ["/bin/entrypoint.sh", "/bin/syncthing", "-home", "/var/syncthing/config"]

+ 3 - 3
tinyfec/Dockerfile

@@ -1,11 +1,11 @@
 FROM playn/alpine as builder
 RUN apk add --no-cache git build-base linux-headers && \
-    git clone --recursive https://github.com/wangyu-/tinyfecVPN.git  && \
+    git clone --depth 1 --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
-COPY --from=builder /tinyfecVPN/tinyvpn /usr/bin/tinyvpn
-ENTRYPOINT [ "/usr/bin/tinyvpn" ]
+COPY --from=builder /tinyfecVPN/tinyvpn /usr/local/bin/tinyvpn
+ENTRYPOINT [ "/usr/local/bin/tinyvpn" ]

+ 20 - 18
traefik/Dockerfile

@@ -1,27 +1,29 @@
 FROM playn/alpine
-ARG version=2.4.9
+# ARG version=2.4.9
 RUN apk --no-cache add ca-certificates
 RUN set -ex; \
-	apkArch="$(apk --print-arch)"; \
-	case "$apkArch" in \
-		armhf) arch='armv6' ;; \
-		aarch64) arch='arm64' ;; \
-		x86_64) arch='amd64' ;; \
-		*) echo >&2 "error: unsupported architecture: $apkArch"; exit 1 ;; \
-	esac; \
-	wget --quiet -O /tmp/traefik.tar.gz "https://github.com/containous/traefik/releases/download/v${version}/traefik_v${version}_linux_$arch.tar.gz"; \
-	tar xzvf /tmp/traefik.tar.gz -C /usr/local/bin traefik; \
-	rm -f /tmp/traefik.tar.gz; \
-	chmod +x /usr/local/bin/traefik
+    apkArch="$(apk --print-arch)"; \
+    case "$apkArch" in \
+        armhf) arch='armv6' ;; \
+        aarch64) arch='arm64' ;; \
+        x86_64) arch='amd64' ;; \
+        *) echo >&2 "error: unsupported architecture: $apkArch"; exit 1 ;; \
+    esac; \
+    export version=$(wget -qO- "https://api.github.com/repos/containous/traefik/releases/latest" | grep '"tag_name":' | head -n 1 | sed -E 's/.*"([^"]+)".*/\1/'); \
+    wget --quiet -O /tmp/traefik.tar.gz "https://github.com/containous/traefik/releases/download/v${version}/traefik_v${version}_linux_$arch.tar.gz"; \
+    tar xzvf /tmp/traefik.tar.gz -C /usr/local/bin traefik; \
+    rm -f /tmp/traefik.tar.gz; \
+    chmod +x /usr/local/bin/traefik; \
+    unset version
 COPY entrypoint.sh /
 EXPOSE 80
 ENTRYPOINT ["/entrypoint.sh"]
 CMD ["traefik"]
 
 # Metadata
-LABEL org.opencontainers.image.vendor="Containous" \
-	org.opencontainers.image.url="https://traefik.io" \
-	org.opencontainers.image.title="Traefik" \
-	org.opencontainers.image.description="A modern reverse-proxy" \
-	org.opencontainers.image.version="v${version}" \
-	org.opencontainers.image.documentation="https://docs.traefik.io"
+# LABEL org.opencontainers.image.vendor="Containous" \
+#     org.opencontainers.image.url="https://traefik.io" \
+#     org.opencontainers.image.title="Traefik" \
+#     org.opencontainers.image.description="A modern reverse-proxy" \
+#     org.opencontainers.image.version="v${version}" \
+#     org.opencontainers.image.documentation="https://docs.traefik.io"

+ 6 - 6
trojan-go/Dockerfile

@@ -1,11 +1,11 @@
 FROM golang:alpine AS builder
 WORKDIR /
-RUN apk add git make &&\
-        git clone https://github.com/p4gefau1t/trojan-go.git &&\
-        cd trojan-go &&\
-        make &&\
-        wget https://github.com/v2ray/domain-list-community/raw/release/dlc.dat -O build/geosite.dat &&\
-        wget https://github.com/v2ray/geoip/raw/release/geoip.dat -O build/geoip.dat
+RUN apk add git make && \
+        git clone --depth 1 https://github.com/p4gefau1t/trojan-go.git && \
+        cd trojan-go && \
+        make && \
+        wget https://github.com/ngbs/rules-dat/blob/release/geosite.dat -O build/geosite.dat && \
+        wget https://github.com/ngbs/rules-dat/blob/release/geoip.dat -O build/geoip.dat
 
 FROM playn/alpine
 WORKDIR /

+ 12 - 12
trojan-go/Dockerfile.client

@@ -1,17 +1,17 @@
 FROM golang:alpine AS builder
 WORKDIR /
-RUN apk add git &&\
-        git clone https://github.com/p4gefau1t/trojan-go.git &&\
-        cd trojan-go &&\
-        PACKAGE_NAME="github.com/p4gefau1t/trojan-go" &&\
-        VERSION=$(git describe --dirty) &&\
-        COMMIT=$(git rev-parse HEAD) &&\
-        VAR_SETTING="-X ${PACKAGE_NAME}/constant.Version=${VERSION} -X ${PACKAGE_NAME}/constant.Commit=${COMMIT}" &&\
-        go build -tags "client" -ldflags="-s -w ${VAR_SETTING}" &&\
-        mkdir build &&\
-        mv trojan-go build &&\
-        wget https://github.com/v2ray/domain-list-community/raw/release/dlc.dat -O build/geosite.dat &&\
-        wget https://github.com/v2ray/geoip/raw/release/geoip.dat -O build/geoip.dat
+RUN apk add git && \
+        git clone --depth 1 https://github.com/p4gefau1t/trojan-go.git && \
+        cd trojan-go && \
+        PACKAGE_NAME="github.com/p4gefau1t/trojan-go" && \
+        VERSION=$(git describe --dirty) && \
+        COMMIT=$(git rev-parse HEAD) && \
+        VAR_SETTING="-X ${PACKAGE_NAME}/constant.Version=${VERSION} -X ${PACKAGE_NAME}/constant.Commit=${COMMIT}" && \
+        go build -tags "client" -ldflags="-s -w ${VAR_SETTING}" && \
+        mkdir build && \
+        mv trojan-go build && \
+        wget https://github.com/ngbs/rules-dat/blob/release/geosite.dat -O build/geosite.dat && \
+        wget https://github.com/ngbs/rules-dat/blob/release/geoip.dat -O build/geoip.dat
 
 FROM playn/alpine
 COPY --from=builder /trojan-go/build /usr/bin/

+ 12 - 12
trojan-go/Dockerfile.full

@@ -1,17 +1,17 @@
 FROM golang:alpine AS builder
 WORKDIR /
-RUN apk add git &&\
-        git clone https://github.com/p4gefau1t/trojan-go.git &&\
-        cd trojan-go &&\
-        PACKAGE_NAME="github.com/p4gefau1t/trojan-go" &&\
-        VERSION=$(git describe --dirty) &&\
-        COMMIT=$(git rev-parse HEAD) &&\
-        VAR_SETTING="-X ${PACKAGE_NAME}/constant.Version=${VERSION} -X ${PACKAGE_NAME}/constant.Commit=${COMMIT}" &&\
-        go build -tags "full" -ldflags="-s -w ${VAR_SETTING}" &&\
-        mkdir build &&\
-        mv trojan-go build &&\
-        wget https://github.com/v2ray/domain-list-community/raw/release/dlc.dat -O build/geosite.dat &&\
-        wget https://github.com/v2ray/geoip/raw/release/geoip.dat -O build/geoip.dat
+RUN apk add git && \
+        git clone --depth 1 https://github.com/p4gefau1t/trojan-go.git && \
+        cd trojan-go && \
+        PACKAGE_NAME="github.com/p4gefau1t/trojan-go" && \
+        VERSION=$(git describe --dirty) && \
+        COMMIT=$(git rev-parse HEAD) && \
+        VAR_SETTING="-X ${PACKAGE_NAME}/constant.Version=${VERSION} -X ${PACKAGE_NAME}/constant.Commit=${COMMIT}" && \
+        go build -tags "full" -ldflags="-s -w ${VAR_SETTING}" && \
+        mkdir build && \
+        mv trojan-go build && \
+        wget https://github.com/ngbs/rules-dat/blob/release/geosite.dat -O build/geosite.dat && \
+        wget https://github.com/ngbs/rules-dat/blob/release/geoip.dat -O build/geoip.dat
 
 FROM playn/alpine
 COPY --from=builder /trojan-go/build /usr/bin/

+ 7 - 7
trojan-go/Dockerfile.server

@@ -1,12 +1,12 @@
 FROM golang:alpine AS builder
 WORKDIR /
-RUN apk add git &&\
-        git clone https://github.com/p4gefau1t/trojan-go.git &&\
-        cd trojan-go &&\
-        PACKAGE_NAME="github.com/p4gefau1t/trojan-go" &&\
-        VERSION=$(git describe --dirty) &&\
-        COMMIT=$(git rev-parse HEAD) &&\
-        VAR_SETTING="-X ${PACKAGE_NAME}/constant.Version=${VERSION} -X ${PACKAGE_NAME}/constant.Commit=${COMMIT}" &&\
+RUN apk add git && \
+        git clone --depth 1 https://github.com/p4gefau1t/trojan-go.git && \
+        cd trojan-go && \
+        PACKAGE_NAME="github.com/p4gefau1t/trojan-go" && \
+        VERSION=$(git describe --dirty) && \
+        COMMIT=$(git rev-parse HEAD) && \
+        VAR_SETTING="-X ${PACKAGE_NAME}/constant.Version=${VERSION} -X ${PACKAGE_NAME}/constant.Commit=${COMMIT}" && \
         go build -tags "server" -ldflags="-s -w ${VAR_SETTING}"
 
 FROM playn/alpine

+ 3 - 3
udp2raw/Dockerfile

@@ -1,10 +1,10 @@
 FROM playn/alpine as builder
 RUN apk add --no-cache git build-base linux-headers && \
-    git clone https://github.com/wangyu-/udp2raw-tunnel.git  && \
+    git clone --depth 1 https://github.com/wangyu-/udp2raw-tunnel.git  && \
     cd udp2raw-tunnel && \
     make dynamic
 
 FROM playn/alpine
 RUN apk add --no-cache libstdc++ iptables
-COPY --from=builder /udp2raw-tunnel/udp2raw_dynamic /usr/bin/udp2raw
-ENTRYPOINT [ "/usr/bin/udp2raw" ]
+COPY --from=builder /udp2raw-tunnel/udp2raw_dynamic /usr/local/bin/udp2raw
+ENTRYPOINT [ "/usr/local/bin/udp2raw" ]

+ 1 - 1
udp2raw/Dockerfile.dnsresolve

@@ -1,6 +1,6 @@
 FROM playn/alpine as builder
 RUN apk add --no-cache git build-base linux-headers && \
-    git clone https://github.com/wangyu-/udp2raw-tunnel.git  && \
+    git clone --depth 1 https://github.com/wangyu-/udp2raw-tunnel.git  && \
     cd udp2raw-tunnel && \
     make dynamic OPT=-DENABLE_DNS_RESOLVE
 

+ 1 - 1
v2ray/Dockerfile

@@ -1,7 +1,7 @@
 FROM golang:alpine AS builder
 RUN apk --no-cache add git bash curl
 WORKDIR /go/src/v2ray.com/core
-RUN git clone --progress https://github.com/v2fly/v2ray-core.git . && \
+RUN git clone --depth 1 --progress https://github.com/v2fly/v2ray-core.git . && \
     bash ./release/user-package.sh nosource noconf codename=$(git describe --tags) buildname=docker-fly abpathtgz=/tmp/v2ray.tgz && \
     mkdir -p /tmp/v2ray && \
     tar xvfz /tmp/v2ray.tgz -C /tmp/v2ray

+ 6 - 4
v2ray/Dockerfile.fly

@@ -1,10 +1,11 @@
 FROM playn/alpine
-ARG v2fly_version=4.40.1
+# ARG version=4.40.1
 RUN set -ex && \
     apk --no-cache add ca-certificates && \
     mkdir /usr/bin/v2ray && \
     mkdir /var/log/v2ray && \
-    wget https://github.com/v2fly/v2ray-core/releases/download/v${v2fly_version}/v2ray-linux-64.zip -P /tmp && \
+    export version=$(wget -qO- "https://api.github.com/repos/v2fly/v2ray-core/releases/latest" | grep '"tag_name":' | head -n 1 | sed -E 's/.*"([^"]+)".*/\1/') && \
+    wget -c https://github.com/v2fly/v2ray-core/releases/download/v${version}/v2ray-linux-64.zip -P /tmp && \
     unzip /tmp/v2ray-linux-64.zip -d /tmp && \
     mv /tmp/geoip.dat \
        /tmp/geosite.dat \
@@ -13,7 +14,8 @@ RUN set -ex && \
        /usr/bin/v2ray && \
     rm -rf /tmp/* && \
     chmod +x /usr/bin/v2ray/v2ctl && \
-    chmod +x /usr/bin/v2ray/v2ray
+    chmod +x /usr/bin/v2ray/v2ray && \
+    unset version
 
 ENTRYPOINT ["/usr/bin/v2ray/v2ray"]
-ENV PATH /usr/bin/v2ray:$PATH
+ENV PATH /usr/bin/v2ray:$PATH

+ 1 - 1
xray/Dockerfile

@@ -1,7 +1,7 @@
 FROM golang:alpine AS builder
 RUN apk --no-cache add git
 WORKDIR /go/src
-RUN git clone https://github.com/XTLS/Xray-core.git . && \
+RUN git clone --depth 1 https://github.com/xtls/xray-core.git . && \
     CGO_ENABLED=0 go build -o xray -trimpath -ldflags "-s -w -buildid=" ./main
 
 FROM playn/alpine

+ 5 - 3
xray/Dockerfile.xray

@@ -1,17 +1,19 @@
 FROM playn/alpine
-ARG xray_version=1.4.2
+# ARG version=1.4.2
 RUN set -ex && \
     apk --no-cache add ca-certificates && \
     mkdir /usr/bin/xray && \
     mkdir /var/log/xray && \
-    wget https://github.com/XTLS/Xray-core/releases/download/v${xray_version}/Xray-linux-64.zip -P /tmp && \
+    export version=$(wget -qO- "https://api.github.com/repos/xtls/xray-core/releases/latest" | grep '"tag_name":' | head -n 1 | sed -E 's/.*"([^"]+)".*/\1/') && \
+    wget -c https://github.com/xtls/xray-core/releases/download/v${version}/Xray-linux-64.zip -P /tmp && \
     unzip /tmp/Xray-linux-64.zip -d /tmp && \
     mv /tmp/geoip.dat \
        /tmp/geosite.dat \
        /tmp/xray \
        /usr/bin/xray && \
     rm -rf /tmp/* && \
-    chmod +x /usr/bin/xray/xray
+    chmod +x /usr/bin/xray/xray && \
+    unset version
 
 ENTRYPOINT ["/usr/bin/xray/xray"]
 ENV PATH /usr/bin/xray:$PATH