From 1ce8303a34b3e9036e8f7b0ca3b083c43d4bc8d3 Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Mon, 31 Oct 2022 23:38:13 +0800 Subject: [PATCH] build: rust compile of toJSON --- Dockerfile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 304cbcd..e2a2205 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ ARG ALPINE="alpine:3.16" +ARG RUST="rust:1.64-alpine3.16" ARG GOLANG="golang:1.18-alpine3.16" FROM ${ALPINE} AS upx @@ -37,10 +38,10 @@ RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-X main.VersionString=${DN COPY --from=upx /tmp/upx /usr/bin/ RUN upx -9 /tmp/dnsproxy -FROM ${GOLANG} AS toJSON -COPY ./toJSON/ /toJSON/ -WORKDIR /toJSON/ -RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-s -w" && mv toJSON /tmp/ +FROM ${RUST} AS to-json +COPY ./to-json/ /to-json/ +WORKDIR /to-json/ +RUN cargo build --release && mv ./target/release/to-json /tmp/toJSON COPY --from=upx /tmp/upx /usr/bin/ RUN upx -9 /tmp/toJSON @@ -62,7 +63,7 @@ COPY --from=adguard /tmp/AdGuardHome /release/usr/bin/ COPY --from=overture /tmp/overture /release/usr/bin/ COPY --from=dnsproxy /tmp/dnsproxy /release/usr/bin/ COPY --from=cleardns /tmp/cleardns /release/usr/bin/ -COPY --from=toJSON /tmp/toJSON /release/usr/bin/ +COPY --from=to-json /tmp/toJSON /release/usr/bin/ FROM ${ALPINE} COPY --from=build /release/ /