This repository has been archived on 2024-10-26. You can view files and clone it, but cannot push or open issues or pull requests.
staxman-old/Dockerfile

23 lines
740 B
Text
Raw Permalink Normal View History

2023-11-25 13:49:45 +00:00
FROM rust:1-alpine as builder
2023-11-25 13:09:52 +00:00
RUN rustup default stable-x86_64-unknown-linux-musl
2023-11-26 21:14:37 +00:00
RUN apk add --no-cache musl-dev openssl-dev openssl-libs-static pkgconf git
2023-11-25 13:09:52 +00:00
# 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
2023-11-25 13:42:36 +00:00
# Compilation speedup
ENV CARGO_INCREMENTAL=0
2023-11-25 13:09:52 +00:00
WORKDIR /wd
COPY . /wd
RUN cargo build --release --target=x86_64-unknown-linux-musl
2023-11-25 13:49:45 +00:00
FROM alpine
2023-11-25 13:09:52 +00:00
ARG version=unknown
ARG release=unreleased
COPY --from=builder /wd/target/x86_64-unknown-linux-musl/release/staxman /usr/local/bin/
CMD ["staxman"]