From ebbf23f352fb240ee8202da96f21ab56dd65b381 Mon Sep 17 00:00:00 2001 From: Michal Kovarik Date: Mon, 24 Jul 2023 09:24:54 +0200 Subject: [PATCH] STONEBLD-1498 Update base images to rhel based (#47) Updating Dockerfile to use RH based base images. Removed test part since there is separate github workflow. --- Dockerfile | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index f7b6894..6c6edad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,6 @@ # Build the manager binary -FROM golang:1.19 as builder +FROM registry.access.redhat.com/ubi9/go-toolset:1.19.10-4 as builder -WORKDIR /workspace # Copy the Go Modules manifests COPY go.mod go.mod COPY go.sum go.sum @@ -13,21 +12,15 @@ RUN go mod download COPY main.go main.go COPY pkg pkg COPY controllers/ controllers/ -COPY Makefile Makefile -COPY hack hack -COPY config config - -# Test -RUN make test # Build RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager main.go # Use distroless as minimal base image to package the manager binary # Refer to https://github.com/GoogleContainerTools/distroless for more details -FROM gcr.io/distroless/static:nonroot +FROM registry.access.redhat.com/ubi9/ubi-minimal:9.2-691 WORKDIR / -COPY --from=builder /workspace/manager . +COPY --from=builder /opt/app-root/src/manager / USER 65532:65532 ENTRYPOINT ["/manager"]