Skip to content

Commit

Permalink
[ACM-10761] Added RHTAP dockerfile (#658)
Browse files Browse the repository at this point in the history
* added RHTAP dockerfile

Signed-off-by: Disaiah Bennett <[email protected]>

* updated dockerfiles

Signed-off-by: Disaiah Bennett <[email protected]>

* revert Dockerfile.test.prow

Signed-off-by: Disaiah Bennett <[email protected]>

---------

Signed-off-by: Disaiah Bennett <[email protected]>
  • Loading branch information
dislbenn authored Apr 29, 2024
1 parent 306e1ac commit ce530a6
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
30 changes: 30 additions & 0 deletions Dockerfile.rhtap
Original file line number Diff line number Diff line change
@@ -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"]
1 change: 1 addition & 0 deletions Dockerfile.test.prow
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Build the backplane-operator binary
FROM registry.ci.openshift.org/stolostron/builder:go1.21-linux AS builder

WORKDIR /workspace
Expand Down
24 changes: 24 additions & 0 deletions Dockerfile.test.rhtap
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit ce530a6

Please sign in to comment.