1
0
Fork 0
mirror of https://git.sr.ht/~ashkeel/sourcehut-mirror-bridge synced 2024-12-21 22:32:19 +00:00
sourcehut-mirror-bridge/Dockerfile

20 lines
699 B
Text
Raw Normal View History

FROM rust:1-alpine as builder
2023-11-13 13:20:13 +00:00
RUN rustup default stable
RUN apk add --no-cache musl-dev openssl-dev openssl-libs-static pkgconf git
# Set `SYSROOT` to a dummy path (default is /usr) because pkg-config-rs *always*
# links those located in that path dynamically but we want static linking, c.f.
# https://github.com/rust-lang/pkg-config-rs/blob/54325785816695df031cef3b26b6a9a203bbc01b/src/lib.rs#L613
ENV SYSROOT=/dummy
WORKDIR /wd
COPY . /wd
RUN cargo build --release --target=x86_64-unknown-linux-musl
FROM alpine
2023-11-13 13:20:13 +00:00
ARG version=unknown
ARG release=unreleased
COPY --from=builder /wd/target/x86_64-unknown-linux-musl/release/sourcehut-mirror-bridge /usr/local/bin/
CMD ["sourcehut-mirror-bridge"]