diff --git a/Dockerfile.rhtap b/Dockerfile.rhtap new file mode 100644 index 000000000..c45ad0a64 --- /dev/null +++ b/Dockerfile.rhtap @@ -0,0 +1,30 @@ +# Build the backplane-operator binary +FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_8_1.21 AS builder + +WORKDIR /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 main.go main.go +COPY api/ api/ +COPY controllers/ controllers/ +COPY pkg/ pkg/ + +# Build +RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o backplane-operator main.go + +# Use distroless as minimal base image to package the manager binary +# Refer to https://github.com/GoogleContainerTools/distroless for more details +FROM registry.access.redhat.com/ubi8/ubi-minimal:latest +WORKDIR /app +COPY --from=builder /workspace/backplane-operator . +COPY --from=builder /workspace/pkg/templates pkg/templates + +USER 65532:65532 + +ENTRYPOINT ["/app/backplane-operator"] diff --git a/Dockerfile.test.prow b/Dockerfile.test.prow index 29df914e6..4e5938589 100644 --- a/Dockerfile.test.prow +++ b/Dockerfile.test.prow @@ -1,3 +1,4 @@ +# Build the backplane-operator binary FROM registry.ci.openshift.org/stolostron/builder:go1.21-linux AS builder WORKDIR /workspace diff --git a/Dockerfile.test.rhtap b/Dockerfile.test.rhtap new file mode 100644 index 000000000..4aa82bce8 --- /dev/null +++ b/Dockerfile.test.rhtap @@ -0,0 +1,24 @@ +FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_8_1.21 AS builder + +WORKDIR /workspace + +COPY api/ api/ +COPY test/function_tests/ test/function_tests/ +COPY go.mod go.mod +COPY go.sum go.sum + +RUN go install github.com/onsi/ginkgo/v2/ginkgo@latest +RUN ginkgo build test/function_tests/backplane_operator_install_test + +FROM registry.access.redhat.com/ubi8/ubi-minimal:latest + +ENV KUBECONFIG "/opt/.kube/config" +ENV RESOURCE_DIR "resources" + +USER root +WORKDIR /test + +COPY --from=builder /workspace/test/function_tests/backplane_operator_install_test/backplane_operator_install_test.test backplane_operator_install_test/backplane_operator_install_test.test +COPY --from=builder /workspace/test/function_tests/resources/ resources/ + +CMD ["/test/backplane_operator_install_test/backplane_operator_install_test.test" , "-ginkgo.v"]