Skip to content

Commit 4f47fd6

Browse files
authored
NETOBSERV-2150: add license and readme to downstream container (#219)
* NETOBSERV-2150: add license to downstream container * Fix licenses, cleanup dockerfile
1 parent 164c8e5 commit 4f47fd6

File tree

6 files changed

+44
-38
lines changed

6 files changed

+44
-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-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: 9 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,15 +35,15 @@ 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

5043
COPY --from=builder /opt/app-root/build .
5144
COPY --from=builder --chown=65532:65532 /opt/app-root/output /output
45+
COPY LICENSE /licenses/
46+
COPY README.downstream ./README
5247

5348
COPY --from=ose-cli /usr/bin/kubectl /usr/bin/kubectl
5449
COPY --from=ose-cli /usr/bin/oc /usr/bin/oc
@@ -64,7 +59,5 @@ LABEL io.k8s.description="Network Observability CLI"
6459
LABEL summary="Network Observability CLI"
6560
LABEL maintainer="[email protected]"
6661
LABEL io.openshift.tags="network-observability-cli"
67-
LABEL upstream-vcs-type="git"
68-
LABEL upstream-vcs-ref=$COMMIT
6962
LABEL description="Network Observability CLI is a lightweight Flow, Packet and Metrics visualization tool for on-demand monitoring."
7063
LABEL version=$BUILDVERSION

README.downstream

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Network Observability CLI
2+
3+
- Online documentation: https://docs.redhat.com/en/documentation/openshift_container_platform/latest/html/network_observability/network-observability-cli-1
4+
- Source code repository: https://github.com/netobserv/network-observability-cli

0 commit comments

Comments
 (0)