Skip to content

Commit de82e8a

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 7425d52 + b696c86 commit de82e8a

File tree

1 file changed

+5
-23
lines changed

1 file changed

+5
-23
lines changed

Dockerfile

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,8 @@
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
5+
ARG TARGETARCH
236

247
WORKDIR /workspace
258
# Copy the Go Modules manifests
@@ -32,11 +15,10 @@ RUN go mod download
3215
COPY main.go main.go
3316
COPY pkg/ pkg/
3417

35-
# Build
3618
USER root
37-
RUN CGO_ENABLED=1 GOOS=linux GOARCH=${GOARCH} make go-build-for-image
19+
RUN CGO_ENABLED=1 GOOS=linux GOARCH=${TARGETARCH:-amd64} make go-build-for-image
3820

39-
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.8
21+
FROM registry.access.redhat.com/ubi9/ubi-minimal:latest
4022
WORKDIR /
4123
COPY --from=builder /workspace/manager .
4224

0 commit comments

Comments
 (0)