File tree Expand file tree Collapse file tree 1 file changed +4
-24
lines changed Expand file tree Collapse file tree 1 file changed +4
-24
lines changed Original file line number Diff line number Diff line change 11# Build the manager binary
2+ FROM registry.access.redhat.com/ubi9/go-toolset:1.23 AS builder
23
3- # BEGIN -- workaround lack of go-toolset for golang 1.23
4- ARG GOLANG_IMAGE=docker.io/library/golang:1.23
5- FROM ${GOLANG_IMAGE} AS golang
6-
7- FROM registry.access.redhat.com/ubi8/ubi@sha256:fd3bf22d0593e2ed26a1c74ce161c52295711a67de677b5938c87704237e49b0 AS builder
8- ARG GOLANG_VERSION=1.23.0
9-
10- # Install system dependencies
11- RUN dnf upgrade -y && dnf install -y \
12- gcc \
13- make \
14- openssl-devel \
15- git \
16- && dnf clean all && rm -rf /var/cache/yum
17-
18- # Install Go
19- ENV PATH=/usr/local/go/bin:$PATH
20-
21- COPY --from=golang /usr/local/go /usr/local/go
22- # End of Go versioning workaround
4+ ARG TARGETOS TARGETARCH
235
246WORKDIR /workspace
257# Copy the Go Modules manifests
@@ -32,11 +14,9 @@ RUN go mod download
3214COPY main.go main.go
3315COPY pkg/ pkg/
3416
35- # Build
36- USER root
37- RUN CGO_ENABLED=1 GOOS=linux GOARCH=${GOARCH} make go-build-for-image
17+ RUN CGO_ENABLED=1 GOOS=linux GOARCH=${TARGETARCH:-amd64} make go-build-for-image
3818
39- FROM registry.access.redhat.com/ubi8 /ubi-minimal:8.8
19+ FROM registry.access.redhat.com/ubi9 /ubi-minimal:latest
4020WORKDIR /
4121COPY --from=builder /workspace/manager .
4222
You can’t perform that action at this time.
0 commit comments