Use linked copy.

This commit is contained in:
Tom Alexander 2024-10-20 23:03:40 -04:00
parent 16a39809e4
commit a17f6502c0
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -7,12 +7,12 @@ RUN apk add --no-cache musl-dev pkgconfig libressl-dev
RUN mkdir /source RUN mkdir /source
WORKDIR /source WORKDIR /source
COPY . . COPY --link . .
# TODO: Add static build, which currently errors due to proc_macro. RUSTFLAGS="-C target-feature=+crt-static" # TODO: Add static build, which currently errors due to proc_macro. RUSTFLAGS="-C target-feature=+crt-static"
RUN --mount=type=tmpfs,target=/tmp --mount=type=cache,target=/usr/local/cargo/registry,sharing=locked CARGO_TARGET_DIR=/target cargo build --profile release-lto --bin webhook_bridge RUN --mount=type=tmpfs,target=/tmp --mount=type=cache,target=/usr/local/cargo/registry,sharing=locked CARGO_TARGET_DIR=/target cargo build --profile release-lto --bin webhook_bridge
FROM alpine:$ALPINE_VERSION AS runner FROM alpine:$ALPINE_VERSION AS runner
COPY --from=builder /target/release-lto/webhook_bridge /usr/bin/ COPY --link --from=builder /target/release-lto/webhook_bridge /usr/bin/
ENTRYPOINT ["/usr/bin/webhook_bridge"] ENTRYPOINT ["/usr/bin/webhook_bridge"]