Skip to content

Commit

Permalink
added RHTAP dockerfile (#232)
Browse files Browse the repository at this point in the history
Signed-off-by: Disaiah Bennett <[email protected]>
  • Loading branch information
dislbenn authored Apr 29, 2024
1 parent 3e8a54d commit 9ccf847
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Dockerfile.rhtap
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Build the manager binary
FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_8_1.21 AS plugin-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 . .

# Build
RUN go build -a -o manager main.go

# Use ubi-minimal as minimal base image to package the manager binary
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
WORKDIR /
COPY --from=builder /workspace/manager .

ENTRYPOINT ["/manager"]
25 changes: 25 additions & 0 deletions Dockerfile.test.rhtap
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright Contributors to the Open Cluster Management project

FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_8_1.21 AS plugin-builder

WORKDIR /workspace

COPY api/ api/
COPY test/e2e/ test/e2e/
COPY go.mod go.mod
COPY go.sum go.sum

RUN go install github.com/onsi/ginkgo/v2/ginkgo@latest
RUN ginkgo build test/e2e

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

ENV KUBECONFIG "/opt/.kube/config"

USER root

WORKDIR /

COPY --from=builder /workspace/test/e2e/e2e.test e2e.test

ENTRYPOINT ["/e2e.test", "--ginkgo.v", "--ginkgo.junit-report=./results/e2e-results.xml"]
27 changes: 27 additions & 0 deletions Dockerfile.testserver.rhtap
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright Contributors to the Open Cluster Management project

FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_8_1.21 AS plugin-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 . .

# Build
RUN go build -a -o local-server testserver/main.go

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

WORKDIR /
COPY --from=builder /workspace/local-server .
COPY testserver/data/ data/

ENTRYPOINT ["/local-server"]

0 comments on commit 9ccf847

Please sign in to comment.