Skip to content

Commit a7efed4

Browse files
committed
Fix licenses, cleanup dockerfile
1 parent 95102e3 commit a7efed4

6 files changed

+79
-38
lines changed

.tekton/network-observability-cli-container-pull-request.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ spec:
2626
value: quay.io/redhat-user-workloads/ocp-network-observab-tenant/netobserv-operator/network-observability-cli-container:on-pr-{{revision}}
2727
- name: image-expires-after
2828
value: 5d
29+
- name: build-args-file
30+
value: Dockerfile-args.downstream
2931
- name: dockerfile
3032
value: Dockerfile.downstream
33+
- name: build-platforms
34+
value: ["linux/x86_64"]
3135
pipelineRef:
3236
name: build-pipeline

.tekton/network-observability-cli-container-push.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ spec:
2323
value: '{{revision}}'
2424
- name: output-image
2525
value: quay.io/redhat-user-workloads/ocp-network-observab-tenant/netobserv-operator/network-observability-cli-container:{{revision}}
26+
- name: image-expires-after
27+
value: 14d
28+
- name: build-args-file
29+
value: Dockerfile-args.downstream
2630
- name: dockerfile
2731
value: Dockerfile.downstream
2832
pipelineRef:

.tekton/pipeline-ref.yaml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -247,28 +247,6 @@ spec:
247247
operator: in
248248
values:
249249
- "true"
250-
- name: rpms-signature-scan
251-
params:
252-
- name: image-url
253-
value: $(tasks.build-image-index.results.IMAGE_URL)
254-
- name: image-digest
255-
value: $(tasks.build-image-index.results.IMAGE_DIGEST)
256-
runAfter:
257-
- build-image-index
258-
taskRef:
259-
params:
260-
- name: name
261-
value: rpms-signature-scan
262-
- name: bundle
263-
value: quay.io/konflux-ci/tekton-catalog/task-rpms-signature-scan:0.2@sha256:d00d159c370e3c99447516970c316ef57dfd27c29e0ce3cff50727c9c40936d8
264-
- name: kind
265-
value: task
266-
resolver: bundles
267-
when:
268-
- input: $(params.skip-checks)
269-
operator: in
270-
values:
271-
- "false"
272250
- name: build-source-image
273251
params:
274252
- name: BINARY_IMAGE
@@ -319,6 +297,28 @@ spec:
319297
operator: in
320298
values:
321299
- "false"
300+
- name: rpms-signature-scan
301+
params:
302+
- name: image-url
303+
value: $(tasks.build-image-index.results.IMAGE_URL)
304+
- name: image-digest
305+
value: $(tasks.build-image-index.results.IMAGE_DIGEST)
306+
runAfter:
307+
- build-image-index
308+
taskRef:
309+
params:
310+
- name: name
311+
value: rpms-signature-scan
312+
- name: bundle
313+
value: quay.io/konflux-ci/tekton-catalog/task-rpms-signature-scan:0.2@sha256:d00d159c370e3c99447516970c316ef57dfd27c29e0ce3cff50727c9c40936d8
314+
- name: kind
315+
value: task
316+
resolver: bundles
317+
when:
318+
- input: $(params.skip-checks)
319+
operator: in
320+
values:
321+
- "false"
322322
- name: clair-scan
323323
params:
324324
- name: image-digest

Dockerfile copy.downstream

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
ARG BUILDVERSION
2+
ARG FRONTBUILD
3+
4+
FROM $FRONTBUILD as web-builder
5+
6+
FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:v1.23 as go-builder
7+
8+
ARG BUILDVERSION
9+
10+
WORKDIR /opt/app-root
11+
12+
COPY go.mod go.mod
13+
COPY go.sum go.sum
14+
COPY vendor/ vendor/
15+
COPY cmd/ cmd/
16+
COPY pkg/ pkg/
17+
18+
ENV GOEXPERIMENT strictfipsruntime
19+
RUN go build -tags strictfipsruntime -ldflags "-X 'main.buildVersion=$BUILDVERSION' -X 'main.buildDate=`date +%Y-%m-%d\ %H:%M`'" -mod vendor -o plugin-backend cmd/plugin-backend.go
20+
21+
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.5-1739420147
22+
ARG BUILDVERSION
23+
24+
COPY --from=web-builder /opt/app-root/web/dist ./web/dist
25+
COPY --from=go-builder /opt/app-root/plugin-backend ./
26+
COPY LICENSE /licenses/
27+
28+
USER 65532:65532
29+
30+
ENTRYPOINT ["./plugin-backend"]
31+
32+
LABEL com.redhat.component="network-observability-console-plugin-container"
33+
LABEL name="network-observability-console-plugin"
34+
LABEL io.k8s.display-name="Network Observability Console Plugin"
35+
LABEL io.k8s.description="Network Observability Console Plugin"
36+
LABEL summary="Network Observability Console Plugin"
37+
LABEL maintainer="support@redhat.com"
38+
LABEL io.openshift.tags="network-observability-console-plugin"
39+
LABEL description="Network Observability visualization tool for the OpenShift Console."
40+
LABEL version=$BUILDVERSION

Dockerfile-args.downstream

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
BUILDVERSION=1.9.0

Dockerfile.downstream

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
1-
# We do not use --platform feature to auto fill this ARG because of incompatibility between podman and docker
2-
ARG TARGETARCH
3-
ARG COMMIT
1+
ARG BUILDVERSION
42

53
# Make kubectl & oc scripts available for copy
64
FROM registry.redhat.io/openshift4/ose-cli-rhel9:v4.18.0-202502040032.p0.ga50d4c0.assembly.stream.el9 as ose-cli
75

86
# Build the manager binary
97
FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:v1.23 as builder
10-
11-
ARG TARGETARCH=amd64
12-
ARG COMMIT
13-
ARG BUILDVERSION="1.9.0"
14-
ARG IMAGE=registry.redhat.io/network-observability/network-observability-cli-rhel9:1.8
15-
ARG AGENT_IMAGE=registry.redhat.io/network-observability/network-observability-ebpf-agent-rhel9:1.8
8+
ARG BUILDVERSION
9+
ARG IMAGE=registry.redhat.io/network-observability/network-observability-cli-rhel9:${BUILDVERSION}
10+
ARG AGENT_IMAGE=registry.redhat.io/network-observability/network-observability-ebpf-agent-rhel9:${BUILDVERSION}
1611

1712
WORKDIR /opt/app-root
1813

@@ -24,7 +19,7 @@ COPY vendor/ vendor/
2419

2520
# Build collector
2621
ENV GOEXPERIMENT strictfipsruntime
27-
RUN GOARCH=$TARGETARCH go build -tags strictfipsruntime -ldflags "-X 'main.buildVersion=${BUILDVERSION}' -X 'main.buildDate=`date +%Y-%m-%d\ %H:%M`'" -mod vendor -a -o build/network-observability-cli
22+
RUN go build -tags strictfipsruntime -ldflags "-X 'main.buildVersion=${BUILDVERSION}' -X 'main.buildDate=`date +%Y-%m-%d\ %H:%M`'" -mod vendor -a -o build/network-observability-cli
2823

2924
# We still need Makefile & resources for oc-commands; copy them after go build for caching
3025
COPY commands/ commands/
@@ -40,10 +35,8 @@ RUN USER=netobserv VERSION="$BUILDVERSION" IMAGE="$IMAGE" AGENT_IMAGE="$AGENT_IM
4035
RUN mkdir -p output
4136

4237
# Create final image from ubi + built binary and command
43-
FROM --platform=linux/$TARGETARCH registry.access.redhat.com/ubi9/ubi:9.5-1741850090
44-
45-
ARG COMMIT
46-
ARG BUILDVERSION="1.9.0"
38+
FROM registry.access.redhat.com/ubi9/ubi:9.5-1741850090
39+
ARG BUILDVERSION
4740

4841
WORKDIR /
4942

@@ -54,6 +47,7 @@ COPY README.downstream ./README
5447

5548
COPY --from=ose-cli /usr/bin/kubectl /usr/bin/kubectl
5649
COPY --from=ose-cli /usr/bin/oc /usr/bin/oc
50+
COPY LICENSE /licenses/
5751

5852
USER 65532:65532
5953

@@ -66,7 +60,5 @@ LABEL io.k8s.description="Network Observability CLI"
6660
LABEL summary="Network Observability CLI"
6761
LABEL maintainer="support@redhat.com"
6862
LABEL io.openshift.tags="network-observability-cli"
69-
LABEL upstream-vcs-type="git"
70-
LABEL upstream-vcs-ref=$COMMIT
7163
LABEL description="Network Observability CLI is a lightweight Flow, Packet and Metrics visualization tool for on-demand monitoring."
7264
LABEL version=$BUILDVERSION

0 commit comments

Comments
 (0)