diff --git a/Dockerfile.rhoai b/Dockerfile.rhoai new file mode 100644 index 0000000000..cb2fcee4df --- /dev/null +++ b/Dockerfile.rhoai @@ -0,0 +1,28 @@ +# Build the manager binary +FROM registry.access.redhat.com/ubi9/go-toolset:1.21 as builder + +WORKDIR /workspace + +RUN git config --global --add safe.directory /workspace + +# Copy the Go Modules manifests +COPY go.mod go.mod +COPY go.sum go.sum +# cache deps before building and copying source so that we don't need to re-download as much +# and so that source changes don't invalidate our downloaded layer +RUN go mod download + +# Copy the go source +COPY . . + +# Build +RUN make build GO_BUILD_ENV='CGO_ENABLED=1 GOOS=linux' + +FROM registry.access.redhat.com/ubi9/ubi:latest + +WORKDIR / +USER root +COPY --from=builder /workspace/bin/manager /manager +USER 65532:65532 + +ENTRYPOINT ["/manager"] \ No newline at end of file