Browse Source

update: xray version `1.6.0`, sagray version `5.0.17`

v1.x.x
Dnomd343 2 years ago
parent
commit
2c1e6264ce
  1. 19
      Dockerfile

19
Dockerfile

@ -1,6 +1,7 @@
ARG GOLANG_IMG="golang:1.18-alpine3.16" ARG ALPINE_IMG="alpine:3.16"
ARG GOLANG_IMG="golang:1.19-alpine3.16"
FROM alpine:3.16 AS upx FROM ${ALPINE_IMG} AS upx
ENV UPX_VER="3.96" ENV UPX_VER="3.96"
RUN sed -i 's/v3.\d\d/v3.15/' /etc/apk/repositories && apk add bash build-base perl ucl-dev zlib-dev RUN sed -i 's/v3.\d\d/v3.15/' /etc/apk/repositories && apk add bash build-base perl ucl-dev zlib-dev
RUN wget https://github.com/upx/upx/releases/download/v${UPX_VER}/upx-${UPX_VER}-src.tar.xz && tar xf upx-${UPX_VER}-src.tar.xz RUN wget https://github.com/upx/upx/releases/download/v${UPX_VER}/upx-${UPX_VER}-src.tar.xz && tar xf upx-${UPX_VER}-src.tar.xz
@ -9,7 +10,7 @@ RUN make -C ./src/ && mkdir -p /upx/bin/ && mv ./src/upx.out /upx/bin/upx && \
mkdir -p /upx/lib/ && cd /usr/lib/ && cp -d ./libgcc_s.so* ./libstdc++.so* ./libucl.so* /upx/lib/ mkdir -p /upx/lib/ && cd /usr/lib/ && cp -d ./libgcc_s.so* ./libstdc++.so* ./libucl.so* /upx/lib/
FROM ${GOLANG_IMG} AS xray FROM ${GOLANG_IMG} AS xray
ENV XRAY_VER="1.5.10" ENV XRAY_VER="1.6.0"
RUN wget https://github.com/XTLS/Xray-core/archive/refs/tags/v${XRAY_VER}.tar.gz && tar xf v${XRAY_VER}.tar.gz RUN wget https://github.com/XTLS/Xray-core/archive/refs/tags/v${XRAY_VER}.tar.gz && tar xf v${XRAY_VER}.tar.gz
WORKDIR ./Xray-core-${XRAY_VER}/main/ WORKDIR ./Xray-core-${XRAY_VER}/main/
RUN go get -d RUN go get -d
@ -23,9 +24,11 @@ RUN go get -d
RUN env CGO_ENABLED=0 go build -v -o v2ray -trimpath -ldflags "-s -w" && mv v2ray /tmp/ RUN env CGO_ENABLED=0 go build -v -o v2ray -trimpath -ldflags "-s -w" && mv v2ray /tmp/
FROM ${GOLANG_IMG} AS sagray FROM ${GOLANG_IMG} AS sagray
ENV SAGER_VER="5.0.16" #ENV SAGER_VER="5.0.16"
RUN wget https://github.com/SagerNet/v2ray-core/archive/refs/tags/v${SAGER_VER}.tar.gz && tar xf v${SAGER_VER}.tar.gz #RUN wget https://github.com/SagerNet/v2ray-core/archive/refs/tags/v${SAGER_VER}.tar.gz && tar xf v${SAGER_VER}.tar.gz
WORKDIR ./v2ray-core-${SAGER_VER}/main/ #WORKDIR ./v2ray-core-${SAGER_VER}/main/
RUN apk add git && git clone https://github.com/SagerNet/v2ray-core.git
WORKDIR ./v2ray-core/main/
RUN go get -d RUN go get -d
RUN env CGO_ENABLED=0 go build -v -o sagray -trimpath -ldflags "-s -w" && mv sagray /tmp/ RUN env CGO_ENABLED=0 go build -v -o sagray -trimpath -ldflags "-s -w" && mv sagray /tmp/
@ -35,7 +38,7 @@ WORKDIR /XProxy/cmd/
RUN go get -d RUN go get -d
RUN env CGO_ENABLED=0 go build -v -o xproxy -trimpath -ldflags "-s -w" && mv xproxy /tmp/ RUN env CGO_ENABLED=0 go build -v -o xproxy -trimpath -ldflags "-s -w" && mv xproxy /tmp/
FROM alpine:3.16 AS asset FROM ${ALPINE_IMG} AS asset
WORKDIR /tmp/ WORKDIR /tmp/
RUN wget "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat" && \ RUN wget "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat" && \
wget "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat" wget "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat"
@ -47,7 +50,7 @@ COPY --from=xray /tmp/xray /asset/usr/bin/
COPY --from=upx /upx/ /usr/ COPY --from=upx /upx/ /usr/
RUN ls /asset/usr/bin/* | xargs -P0 -n1 upx -9 RUN ls /asset/usr/bin/* | xargs -P0 -n1 upx -9
FROM alpine:3.16 FROM ${ALPINE_IMG}
RUN apk add --no-cache dhcp iptables ip6tables radvd && \ RUN apk add --no-cache dhcp iptables ip6tables radvd && \
mkdir -p /run/radvd/ && rm -f /etc/dhcp/dhcpd.conf.example && \ mkdir -p /run/radvd/ && rm -f /etc/dhcp/dhcpd.conf.example && \
touch /var/lib/dhcp/dhcpd.leases && touch /var/lib/dhcp/dhcpd6.leases touch /var/lib/dhcp/dhcpd.leases && touch /var/lib/dhcp/dhcpd6.leases

Loading…
Cancel
Save