diff --git a/Dockerfile.downstream b/Dockerfile.downstream index 9b4b5623de9fda9a2ad3587108d566f70bd99366..fda169389d7d8fe072aae265074a9dc1ac67d29d 100644 --- a/Dockerfile.downstream +++ b/Dockerfile.downstream @@ -1,27 +1,30 @@ +ARG TARGETARCH +ARG COMMIT + # Build the manager binary -FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:v1.23 as builder +FROM --platform=linux/$TARGETARCH brew.registry.redhat.io/rh-osbs/openshift-golang-builder:v1.23 as builder -ARG VERSION="unknown" +ARG TARGETARCH=amd64 +ARG BUILDVERSION="1.8.0" ARG COMMIT WORKDIR /opt/app-root # Copy the go manifests and source -COPY .git/ .git/ COPY bpf/ bpf/ COPY cmd/ cmd/ COPY pkg/ pkg/ COPY vendor/ vendor/ COPY go.mod go.mod COPY go.sum go.sum -COPY Makefile Makefile -COPY .mk/ .mk/ # Build -RUN make compile +RUN GOARCH=$TARGETARCH go build -ldflags "-X 'main.buildVersion=${BUILDVERSION}' -X 'main.buildDate=`date +%Y-%m-%d\ %H:%M`'" -mod vendor -a -o bin/netobserv-ebpf-agent cmd/netobserv-ebpf-agent.go # Create final image from minimal + built binary -FROM registry.access.redhat.com/ubi9/ubi-minimal:9.5-1738816775 +FROM --platform=linux/$TARGETARCH registry.access.redhat.com/ubi9/ubi-minimal:9.5-1738816775 +ARG COMMIT + WORKDIR / COPY --from=builder /opt/app-root/bin/netobserv-ebpf-agent . USER 65532:65532 @@ -35,7 +38,7 @@ LABEL io.k8s.description="Network Observability eBPF Agent" LABEL summary="Network Observability eBPF Agent" LABEL maintainer="support@redhat.com" LABEL io.openshift.tags="network-observability-ebpf-agent" -LABEL upstream-vcs-ref="$COMMIT" +LABEL upstream-vcs-ref=$COMMIT LABEL upstream-vcs-type="git" LABEL description="The Network Observability eBPF Agent allows collecting and aggregating all the ingress and egress flows on a Linux host." -LABEL version="1.8.0" +LABEL version=$BUILDVERSION