File tree Expand file tree Collapse file tree 1 file changed +4
-23
lines changed Expand file tree Collapse file tree 1 file changed +4
-23
lines changed Original file line number Diff line number Diff line change 1
1
# Build the manager binary
2
+ FROM registry.access.redhat.com/ubi9/go-toolset:1.23 AS builder
2
3
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
23
5
24
6
WORKDIR /workspace
25
7
# Copy the Go Modules manifests
@@ -32,11 +14,10 @@ RUN go mod download
32
14
COPY main.go main.go
33
15
COPY pkg/ pkg/
34
16
35
- # Build
36
17
USER root
37
- RUN CGO_ENABLED=1 GOOS=linux GOARCH=${GOARCH } make go-build-for-image
18
+ RUN CGO_ENABLED=1 GOOS=linux GOARCH=${TARGETARCH:-amd64 } make go-build-for-image
38
19
39
- FROM registry.access.redhat.com/ubi8 /ubi-minimal:8.8
20
+ FROM registry.access.redhat.com/ubi9 /ubi-minimal:latest
40
21
WORKDIR /
41
22
COPY --from=builder /workspace/manager .
42
23
You can’t perform that action at this time.
0 commit comments