Skip to content

Commit ba3e933

Browse files
Align downstream dockerfile with the upstream one (#557)
* Align downstream dockerfile with the upstream one * Update Dockerfile.downstream Co-authored-by: Julien Pinsonneau <[email protected]> --------- Co-authored-by: Julien Pinsonneau <[email protected]>
1 parent 933a294 commit ba3e933

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

Dockerfile.downstream

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,30 @@
1+
ARG TARGETARCH
2+
ARG COMMIT
3+
14
# Build the manager binary
2-
FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:v1.23 as builder
5+
FROM --platform=linux/$TARGETARCH brew.registry.redhat.io/rh-osbs/openshift-golang-builder:v1.23 as builder
36

7+
ARG TARGETARCH=amd64
48
ARG VERSION="unknown"
59
ARG COMMIT
610

711
WORKDIR /opt/app-root
812

913
# Copy the go manifests and source
10-
COPY .git/ .git/
1114
COPY bpf/ bpf/
1215
COPY cmd/ cmd/
1316
COPY pkg/ pkg/
1417
COPY vendor/ vendor/
1518
COPY go.mod go.mod
1619
COPY go.sum go.sum
17-
COPY Makefile Makefile
18-
COPY .mk/ .mk/
1920

2021
# Build
21-
RUN make compile
22+
RUN GOARCH=$TARGETARCH go build -ldflags "-X 'main.buildVersion=${VERSION}-${COMMIT}' -X 'main.buildDate=`date +%Y-%m-%d\ %H:%M`'" -mod vendor -a -o bin/netobserv-ebpf-agent cmd/netobserv-ebpf-agent.go
2223

2324
# Create final image from minimal + built binary
24-
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.5-1738816775
25+
FROM --platform=linux/$TARGETARCH registry.access.redhat.com/ubi9/ubi-minimal:9.5-1738816775
26+
ARG COMMIT
27+
2528
WORKDIR /
2629
COPY --from=builder /opt/app-root/bin/netobserv-ebpf-agent .
2730
USER 65532:65532

0 commit comments

Comments
 (0)