Skip to content

Commit 0398f3b

Browse files
Fix multiarch build with new buildah version (#100)
1 parent 6ff0e29 commit 0398f3b

File tree

4 files changed

+7
-53
lines changed

4 files changed

+7
-53
lines changed

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

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ spec:
9494
description: Skip checks against built image
9595
name: skip-checks
9696
type: string
97-
- default: "false"
97+
- default: "true"
9898
description: Execute the build with network isolation
9999
name: hermetic
100100
type: string
@@ -405,28 +405,6 @@ spec:
405405
operator: in
406406
values:
407407
- "false"
408-
- name: sbom-json-check
409-
params:
410-
- name: IMAGE_URL
411-
value: $(tasks.build-container.results.IMAGE_URL)
412-
- name: IMAGE_DIGEST
413-
value: $(tasks.build-container.results.IMAGE_DIGEST)
414-
runAfter:
415-
- build-container
416-
taskRef:
417-
params:
418-
- name: name
419-
value: sbom-json-check
420-
- name: bundle
421-
value: quay.io/konflux-ci/tekton-catalog/task-sbom-json-check:0.1@sha256:acc9cb8a714f33c0e48d6ca219b6bd0191f09cdd767af4ef3a35d0a5cac53b5d
422-
- name: kind
423-
value: task
424-
resolver: bundles
425-
when:
426-
- input: $(params.skip-checks)
427-
operator: in
428-
values:
429-
- "false"
430408
- name: apply-tags
431409
params:
432410
- name: IMAGE

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

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ spec:
9191
description: Skip checks against built image
9292
name: skip-checks
9393
type: string
94-
- default: "false"
94+
- default: "true"
9595
description: Execute the build with network isolation
9696
name: hermetic
9797
type: string
@@ -402,28 +402,6 @@ spec:
402402
operator: in
403403
values:
404404
- "false"
405-
- name: sbom-json-check
406-
params:
407-
- name: IMAGE_URL
408-
value: $(tasks.build-container.results.IMAGE_URL)
409-
- name: IMAGE_DIGEST
410-
value: $(tasks.build-container.results.IMAGE_DIGEST)
411-
runAfter:
412-
- build-container
413-
taskRef:
414-
params:
415-
- name: name
416-
value: sbom-json-check
417-
- name: bundle
418-
value: quay.io/konflux-ci/tekton-catalog/task-sbom-json-check:0.1@sha256:acc9cb8a714f33c0e48d6ca219b6bd0191f09cdd767af4ef3a35d0a5cac53b5d
419-
- name: kind
420-
value: task
421-
resolver: bundles
422-
when:
423-
- input: $(params.skip-checks)
424-
operator: in
425-
values:
426-
- "false"
427405
- name: apply-tags
428406
params:
429407
- name: IMAGE

Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
# We do not use --platform feature to auto fill this ARG because of incompatibility between podman and docker
2-
ARG TARGETPLATFORM=linux/amd64
3-
ARG BUILDPLATFORM=linux/amd64
42
ARG TARGETARCH=amd64
53

64
# Build the manager binary
7-
FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.22 as builder
5+
FROM docker.io/library/golang:1.22 as builder
86

97
ARG TARGETARCH
108
ARG TARGETPLATFORM
@@ -33,7 +31,7 @@ RUN USER=netobserv VERSION=main make oc-commands
3331
RUN mkdir -p output
3432

3533
# Create final image from ubi + built binary and command
36-
FROM --platform=$TARGETPLATFORM registry.access.redhat.com/ubi9/ubi:9.4
34+
FROM --platform=linux/$TARGETARCH registry.access.redhat.com/ubi9/ubi:9.4
3735
WORKDIR /
3836
COPY --from=builder /opt/app-root/build .
3937
COPY --from=builder --chown=65532:65532 /opt/app-root/output /output

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ MULTIARCH_TARGETS ?= amd64
2323
# In CI, to be replaced by `netobserv`
2424
IMAGE_ORG ?= $(USER)
2525

26-
# Build output
26+
# Build output
2727
NAME := network-observability-cli
2828
DIST_DIR ?= build
2929
FILES_OUTPUT_DIR ?= output
3030
OUTPUT := $(DIST_DIR)/$(NAME)
3131

3232
# Available commands for development with args
3333
COMMANDS = flows packets cleanup
34-
COMMAND_ARGS ?=
34+
COMMAND_ARGS ?=
3535

3636
# Get either oc (favorite) or kubectl paths
3737
K8S_CLI_BIN_PATH = $(shell which oc 2>/dev/null || which kubectl)
@@ -58,7 +58,7 @@ YQ_VERSION = v4.43.1
5858
# build a single arch target provided as argument
5959
define build_target
6060
echo 'building image for arch $(1)'; \
61-
DOCKER_BUILDKIT=1 $(OCI_BIN) buildx build --load --build-arg TARGETPLATFORM=linux/$(1) --build-arg TARGETARCH=$(1) --build-arg BUILDPLATFORM=linux/amd64 ${OCI_BUILD_OPTS} -t ${IMAGE}-$(1) -f Dockerfile .;
61+
DOCKER_BUILDKIT=1 $(OCI_BIN) buildx build --load --build-arg TARGETARCH=$(1) ${OCI_BUILD_OPTS} -t ${IMAGE}-$(1) -f Dockerfile .;
6262
endef
6363

6464
# push a single arch target image

0 commit comments

Comments
 (0)