Skip to content

Commit 51928c9

Browse files
committed
update dockerfile
1 parent d7d84fd commit 51928c9

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

Dockerfile

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ FROM registry.access.redhat.com/ubi9/go-toolset:1.23 AS builder
33

44
ARG TARGETOS TARGETARCH
55

6+
USER root
7+
68
# Install system dependencies
79
RUN dnf upgrade -y && dnf install -y \
810
gcc \
@@ -11,12 +13,6 @@ RUN dnf upgrade -y && dnf install -y \
1113
git \
1214
&& dnf clean all && rm -rf /var/cache/yum
1315

14-
# Install Go
15-
ENV PATH=/usr/local/go/bin:$PATH
16-
17-
COPY --from=golang /usr/local/go /usr/local/go
18-
# End of Go versioning workaround
19-
2016
WORKDIR /workspace
2117
# Copy the Go Modules manifests
2218
COPY go.mod go.mod
@@ -29,7 +25,6 @@ COPY main.go main.go
2925
COPY pkg/ pkg/
3026

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

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

0 commit comments

Comments
 (0)