Skip to content
Snippets Groups Projects
Unverified Commit fc3727da authored by Olivier Cazade's avatar Olivier Cazade Committed by GitHub
Browse files

Align downstream dockerfile with the upstream one (#560)


* Align downstream dockerfile with the upstream one (#557)

* Align downstream dockerfile with the upstream one

* Update Dockerfile.downstream

Co-authored-by: default avatarJulien Pinsonneau <91894519+jpinsonneau@users.noreply.github.com>

---------

Co-authored-by: default avatarJulien Pinsonneau <91894519+jpinsonneau@users.noreply.github.com>

* Fix arg usage for downstream builds (#558)

---------

Co-authored-by: default avatarJulien Pinsonneau <91894519+jpinsonneau@users.noreply.github.com>
parent cee90d9b
No related branches found
No related tags found
No related merge requests found
ARG TARGETARCH
ARG COMMIT
# Build the manager binary # 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 ARG COMMIT
WORKDIR /opt/app-root WORKDIR /opt/app-root
# Copy the go manifests and source # Copy the go manifests and source
COPY .git/ .git/
COPY bpf/ bpf/ COPY bpf/ bpf/
COPY cmd/ cmd/ COPY cmd/ cmd/
COPY pkg/ pkg/ COPY pkg/ pkg/
COPY vendor/ vendor/ COPY vendor/ vendor/
COPY go.mod go.mod COPY go.mod go.mod
COPY go.sum go.sum COPY go.sum go.sum
COPY Makefile Makefile
COPY .mk/ .mk/
# Build # 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 # 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 / WORKDIR /
COPY --from=builder /opt/app-root/bin/netobserv-ebpf-agent . COPY --from=builder /opt/app-root/bin/netobserv-ebpf-agent .
USER 65532:65532 USER 65532:65532
...@@ -35,7 +38,7 @@ LABEL io.k8s.description="Network Observability eBPF Agent" ...@@ -35,7 +38,7 @@ LABEL io.k8s.description="Network Observability eBPF Agent"
LABEL summary="Network Observability eBPF Agent" LABEL summary="Network Observability eBPF Agent"
LABEL maintainer="support@redhat.com" LABEL maintainer="support@redhat.com"
LABEL io.openshift.tags="network-observability-ebpf-agent" LABEL io.openshift.tags="network-observability-ebpf-agent"
LABEL upstream-vcs-ref="$COMMIT" LABEL upstream-vcs-ref=$COMMIT
LABEL upstream-vcs-type="git" 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 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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment