FROM rust:1.88 AS builder
WORKDIR /build
COPY Cargo.toml Cargo.lock ./
COPY crates/ crates/
RUN cargo build --release -p ergo-operator

FROM registry.access.redhat.com/ubi9-minimal:latest
COPY --from=builder /build/target/release/ergo-operator /usr/local/bin/ergo-operator
ENTRYPOINT ["ergo-operator"]
