Skip to content

Commit

Permalink
STONEBLD-1498 Update base images to rhel based (#47)
Browse files Browse the repository at this point in the history
Updating Dockerfile to use RH based base images. Removed test part since
there is separate github workflow.
  • Loading branch information
Michkov authored Jul 24, 2023
1 parent b66b6d1 commit ebbf23f
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"]

0 comments on commit ebbf23f

Please sign in to comment.