FROM registry.ci.openshift.org/stolostron/builder:go1.17-linux AS builder

WORKDIR /go/src/github.com/stolostron/provider-credential-controller
COPY . .

RUN make -f Makefile.prow compile

FROM registry.access.redhat.com/ubi8/ubi-minimal:latest

ENV USER_UID=1001

# Add the binaries
COPY --from=builder /go/src/github.com/stolostron/provider-credential-controller/build/_output/manager .
COPY --from=builder /go/src/github.com/stolostron/provider-credential-controller/build/_output/old-provider-connection .

USER ${USER_UID}