|
|
@@ -6,14 +6,17 @@ RUN apk add git &&\
|
|
|
PACKAGE_NAME="github.com/p4gefau1t/trojan-go" &&\
|
|
|
VERSION=$(git describe --dirty) &&\
|
|
|
COMMIT=$(git rev-parse HEAD) &&\
|
|
|
- BUILD_DIR="build" &&\
|
|
|
VAR_SETTING="-X ${PACKAGE_NAME}/constant.Version=${VERSION} -X ${PACKAGE_NAME}/constant.Commit=${COMMIT}" &&\
|
|
|
- go build -tags "full" -ldflags="-s -w ${VAR_SETTING}" -o ${BUILD_DIR} &&\
|
|
|
+ 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
|
|
|
|
|
|
FROM playn/alpine:3.12.0
|
|
|
COPY --from=builder /trojan-go/build /usr/bin/
|
|
|
+COPY --from=builder /trojan-go/example/server.json /etc/trojan-go/server.json
|
|
|
+COPY --from=builder /trojan-go/example/client.json /etc/trojan-go/client.json
|
|
|
|
|
|
ENTRYPOINT ["/usr/bin/trojan-go"]
|
|
|
-CMD ["-config", "/etc/trojan-go/config.json"]
|
|
|
+CMD ["-config", "/etc/trojan-go/server.json"]
|