Skip to content
Closed
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
28 changes: 4 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,7 @@
# Build the manager binary
FROM registry.access.redhat.com/ubi9/go-toolset:1.23 AS builder

# BEGIN -- workaround lack of go-toolset for golang 1.23
ARG GOLANG_IMAGE=docker.io/library/golang:1.23
FROM ${GOLANG_IMAGE} AS golang

FROM registry.access.redhat.com/ubi8/ubi@sha256:fd3bf22d0593e2ed26a1c74ce161c52295711a67de677b5938c87704237e49b0 AS builder
ARG GOLANG_VERSION=1.23.0

# Install system dependencies
RUN dnf upgrade -y && dnf install -y \
gcc \
make \
openssl-devel \
git \
&& dnf clean all && rm -rf /var/cache/yum

# Install Go
ENV PATH=/usr/local/go/bin:$PATH

COPY --from=golang /usr/local/go /usr/local/go
# End of Go versioning workaround
ARG TARGETOS TARGETARCH

WORKDIR /workspace
# Copy the Go Modules manifests
Expand All @@ -32,11 +14,9 @@ RUN go mod download
COPY main.go main.go
COPY pkg/ pkg/

# Build
USER root
RUN CGO_ENABLED=1 GOOS=linux GOARCH=${GOARCH} make go-build-for-image
RUN CGO_ENABLED=1 GOOS=linux GOARCH=${TARGETARCH:-amd64} make go-build-for-image

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it usual to use the latest tag here for ubi9?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WORKDIR /
COPY --from=builder /workspace/manager .

Expand Down
Loading