Skip to content

Commit

Permalink
Align downstream dockerfile with the upstream one (#557)
Browse files Browse the repository at this point in the history
* Align downstream dockerfile with the upstream one

* Update Dockerfile.downstream

Co-authored-by: Julien Pinsonneau <[email protected]>

---------

Co-authored-by: Julien Pinsonneau <[email protected]>
  • Loading branch information
OlivierCazade and jpinsonneau authored Feb 11, 2025
1 parent 933a294 commit ba3e933
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions Dockerfile.downstream
Original file line number Diff line number Diff line change
@@ -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 TARGETARCH=amd64
ARG VERSION="unknown"
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=${VERSION}-${COMMIT}' -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
Expand Down

0 comments on commit ba3e933

Please sign in to comment.