FROM ghcr.io/edera-dev/cross-base-linux-musl:latest@sha256:d91b0f62494d8163cc5b3daf33bc3690e71528000407960a394681788e16fb94 AS build

ENV TARGET_LIBC=musl TARGET_VENDOR=unknown DISABLE_CROSS_RS=1

WORKDIR /usr/src/app
COPY . .
RUN ./hack/build/cargo.sh build --release --bin edera-check
RUN mv ./target/$(./hack/build/target.sh)/release/edera-check /usr/sbin

FROM cgr.dev/chainguard/wolfi-base:latest
ENTRYPOINT ["/usr/sbin/edera-check"]
COPY --from=build /usr/sbin/edera-check /usr/sbin/edera-check
