From c322c7b4570c76c48934e29754beba6f354e7155 Mon Sep 17 00:00:00 2001 From: Disaiah Bennett Date: Thu, 6 Jun 2024 16:24:16 -0400 Subject: [PATCH] updated Dockerfile.rhtap Signed-off-by: Disaiah Bennett --- Dockerfile.rhtap | 10 +++++++--- Dockerfile.test.rhtap | 25 ------------------------- Dockerfile.testserver.rhtap | 27 --------------------------- 3 files changed, 7 insertions(+), 55 deletions(-) delete mode 100644 Dockerfile.test.rhtap delete mode 100644 Dockerfile.testserver.rhtap diff --git a/Dockerfile.rhtap b/Dockerfile.rhtap index 7b8c649b..2d742347 100644 --- a/Dockerfile.rhtap +++ b/Dockerfile.rhtap @@ -1,5 +1,5 @@ # Build the manager binary -FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_8_1.21 AS plugin-builder +FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_1.21 AS plugin-builder WORKDIR /workspace @@ -14,12 +14,16 @@ RUN go mod download # Copy the go source COPY . . +# Tidy up the go.mod file and vendor dependencies +RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go mod tidy +RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go mod vendor + # Build -RUN go build -a -o manager main.go +RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 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 . +COPY --from=plugin-builder /workspace/manager . ENTRYPOINT ["/manager"] diff --git a/Dockerfile.test.rhtap b/Dockerfile.test.rhtap deleted file mode 100644 index b67a4fb6..00000000 --- a/Dockerfile.test.rhtap +++ /dev/null @@ -1,25 +0,0 @@ -# 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"] diff --git a/Dockerfile.testserver.rhtap b/Dockerfile.testserver.rhtap deleted file mode 100644 index ae840de2..00000000 --- a/Dockerfile.testserver.rhtap +++ /dev/null @@ -1,27 +0,0 @@ -# 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"]