diff --git a/Dockerfile b/Dockerfile index 99ae234..6703faf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -38,16 +38,18 @@ 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 ${RUST} AS cleardns -RUN apk add build-base cmake -COPY ./ /ClearDNS/ -WORKDIR /ClearDNS/src/to-json/ +FROM ${RUST} AS to-json +COPY ./src/to-json/ /to-json/ +WORKDIR /to-json/ RUN cargo build --release -WORKDIR /ClearDNS/bin/ + +FROM ${ALPINE} AS cleardns +RUN apk add build-base cmake +COPY ./ /cleardns/ +COPY --from=to-json /to-json/ /cleardns/src/to-json/ +WORKDIR /cleardns/bin/ RUN cmake -DCMAKE_EXE_LINKER_FLAGS=-static -DCMAKE_BUILD_TYPE=Release .. && make RUN strip cleardns && mv cleardns /tmp/ -COPY --from=upx /tmp/upx /usr/bin/ -RUN upx -9 /tmp/cleardns FROM ${ALPINE} AS build RUN apk add xz