https://blue-build.org/ logo
setup on Gitlab with build --push: how to extract ...
# questions
r
I jump through several loops to get my images scanned with trivy and data visualised with gitlab. 1)
trivy image
fails to scan because the rpmdb.sqlite is in the wrong place and trivy does not follow symlinks: https://github.com/aquasecurity/trivy/discussions/9188#discussioncomment-14162815 2) I run rpm -qa in the image and pipe the output outside the image to construct an SBOM file that can be read with
trivy sbom
The option 2) breaks currently for a reason I do not know. Logs: https://gitlab.com/eu-os/workspace-images/eu-os-base-demo/-/jobs/11086286906 I notice that after
bluebuild build --push ... registry.gitlab.com/...
, my call to
docker run ... registry.gitlab.com/...
leads to a new download of the image. That leads to a slow down. How can I call
docker run
or
podman run
without re-downloading the image?
a
message has been deleted
g
g:reaa
The docker driver when
--push
is used doesn't end up loading the image into the local docker registry becuase the build runs in a buildkit container
You could use the podman build driver, but since you're running in gitlab, that [might not work atm](https://github.com/blue-build/cli/issues/519) until I can find out what's causing that issue
r
I tried with buildah, but got errors during the build already.
Copy code
[09:26:59 r.g.c/e/w/e/eu-os-demo-almalinux:br-almalinux-10] => --> Pushing cache [registry.gitlab.com/eu-os/workspace-images/eu-os-base-demo/eu-os-demo-almalinux]:fc9274ce1a95b435a1f3f456ab71f6a6103e76b1ff0b09bee9e0df6939f38541
[09:27:04 r.g.c/e/w/e/eu-os-demo-almalinux:br-almalinux-10] => --> 5a4011bffca8
[09:27:04 r.g.c/e/w/e/eu-os-demo-almalinux:br-almalinux-10] => [5/5] STEP 11/32: RUN --mount=type=bind,from=stage-keys,src=/keys,dst=/tmp/keys   mkdir -p /etc/pki/containers/   && cp /tmp/keys/* /etc/pki/containers/
[09:27:06 r.g.c/e/w/e/eu-os-demo-almalinux:br-almalinux-10] => internal:0:0-0: Error: Could not process rule: No such file or directory
[09:27:06 r.g.c/e/w/e/eu-os-demo-almalinux:br-almalinux-10] => 
[09:27:06 r.g.c/e/w/e/eu-os-demo-almalinux:br-almalinux-10] => internal:0:0-0: Error: Could not process rule: No such file or directory
[09:27:06 r.g.c/e/w/e/eu-os-demo-almalinux:br-almalinux-10] => 
[09:27:06 r.g.c/e/w/e/eu-os-demo-almalinux:br-almalinux-10] => error running container: did not get container start message from parent: EOF
[09:27:06 r.g.c/e/w/e/eu-os-demo-almalinux:br-almalinux-10] => Error: building at STEP "RUN --mount=type=bind,from=stage-keys,src=/keys,dst=/tmp/keys mkdir -p /etc/pki/containers/   && cp /tmp/keys/* /etc/pki/containers/": setup network: netavark: nftables error: "nft" did not return successfully while applying ruleset
[09:27:06 ERROR blue_build::commands:32] => Failed:
  × Failed to build registry.gitlab.com/eu-os/workspace-images/eu-os-base-
  │ demo/eu-os-demo-almalinux:br-almalinux-10
logs: https://gitlab.com/eu-os/workspace-images/eu-os-base-demo/-/jobs/11091144933
I also hit an error with podman:
Copy code
[18:01:56 r.g.c/e/w/e/eu-os-demo-almalinux:br-almalinux-10] => [5/5] STEP 11/32: RUN --mount=type=bind,from=stage-keys,src=/keys,dst=/tmp/keys   mkdir -p /etc/pki/containers/   && cp /tmp/keys/* /etc/pki/containers/
[18:01:58 r.g.c/e/w/e/eu-os-demo-almalinux:br-almalinux-10] => internal:0:0-0: Error: Could not process rule: No such file or directory
[18:01:58 r.g.c/e/w/e/eu-os-demo-almalinux:br-almalinux-10] => 
[18:01:58 r.g.c/e/w/e/eu-os-demo-almalinux:br-almalinux-10] => internal:0:0-0: Error: Could not process rule: No such file or directory
[18:01:58 r.g.c/e/w/e/eu-os-demo-almalinux:br-almalinux-10] => 
[18:01:58 r.g.c/e/w/e/eu-os-demo-almalinux:br-almalinux-10] => error running container: did not get container start message from parent: EOF
[18:01:58 r.g.c/e/w/e/eu-os-demo-almalinux:br-almalinux-10] => Error: building at STEP "RUN --mount=type=bind,from=stage-keys,src=/keys,dst=/tmp/keys mkdir -p /etc/pki/containers/   && cp /tmp/keys/* /etc/pki/containers/": setup network: netavark: nftables error: "nft" did not return successfully while applying ruleset
[18:01:58 ERROR blue_build::commands:32] => Failed:
  × Failed to build registry.gitlab.com/eu-os/workspace-images/eu-os-base-
  │ demo/eu-os-demo-almalinux:br-almalinux-10
logs: https://gitlab.com/eu-os/workspace-images/eu-os-base-demo/-/jobs/11098685600
g
Mind adding this info to the ticket I linked above?