Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ACM-10761] Added RHTAP dockerfile #232

Merged
merged 1 commit into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]
Loading