Browse Source

perf: combine gost and gost-v3

master
dnomd343 2 years ago
parent
commit
e2f824c1c8
  1. 26
      Dockerfile

26
Dockerfile

@ -314,29 +314,23 @@ RUN cmake .. -DENABLE_MYSQL=OFF -DSYSTEMD_SERVICE=OFF && make && \
strip /tmp/trojan strip /tmp/trojan
COPY --from=trojan-go /tmp/trojan-go /tmp/ COPY --from=trojan-go /tmp/trojan-go /tmp/
# Compile gost-v3 # Compile gost and gost-v3
FROM ${GO18_IMG} AS gost-v3 FROM ${GO18_IMG} AS gost
RUN apk add git
RUN git clone https://github.com/go-gost/gost.git
WORKDIR ./gost/
RUN go mod download -x
RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-s -w" ./cmd/gost && \
mv ./gost /tmp/gost-v3
COPY --from=upx /upx/ /usr/
RUN upx -9 /tmp/gost-v3
# Compile gost
FROM ${GO17_IMG} AS gost
ENV GOST_VERSION="2.11.2" ENV GOST_VERSION="2.11.2"
RUN wget https://github.com/ginuerzh/gost/archive/refs/tags/v${GOST_VERSION}.tar.gz && \ RUN apk add git
RUN git clone https://github.com/go-gost/gost.git ./gost-v3/ && \
wget https://github.com/ginuerzh/gost/archive/refs/tags/v${GOST_VERSION}.tar.gz && \
tar xf v${GOST_VERSION}.tar.gz tar xf v${GOST_VERSION}.tar.gz
WORKDIR ./gost-${GOST_VERSION}/ WORKDIR ./gost-${GOST_VERSION}/
RUN go mod download -x RUN go mod download -x
RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-s -w" ./cmd/gost && \ RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-s -w" ./cmd/gost && \
mv ./gost /tmp/ mv ./gost /tmp/
WORKDIR ../gost-v3/
RUN go mod download -x
RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-s -w" ./cmd/gost && \
mv ./gost /tmp/gost-v3
COPY --from=upx /upx/ /usr/ COPY --from=upx /upx/ /usr/
RUN upx -9 /tmp/gost RUN ls /tmp/gost* | xargs -P0 -n1 upx -9
COPY --from=gost-v3 /tmp/gost-v3 /tmp/
# Compile brook # Compile brook
FROM ${GO16_IMG} AS brook FROM ${GO16_IMG} AS brook

Loading…
Cancel
Save