This repository has been archived on 2024-04-27. You can view files and clone it, but cannot push or open issues or pull requests.
release-info/Dockerfile
2023-11-11 19:52:27 +01:00

20 lines
No EOL
737 B
Docker

FROM public.ecr.aws/docker/library/rust:1-alpine as builder
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 public.ecr.aws/docker/library/alpine
ARG version=unknown
ARG release=unreleased
COPY --from=builder /wd/target/x86_64-unknown-linux-musl/release/release-info /usr/local/bin/
CMD ["release-info"]