FROM rust:alpine AS builder
WORKDIR /usr/src/app
COPY . .
RUN apk add --no-cache musl-dev
RUN cargo install --path .
FROM alpine:3
COPY --from=builder /usr/local/cargo/bin/ci-buildkit-plugin /usr/local/bin/buildkit-plugin
COPY --from=moby/buildkit /usr/bin/buildctl /usr/bin/buildctl
CMD ["buildkit-plugin"]