cdxgen icon indicating copy to clipboard operation
cdxgen copied to clipboard

Running CDXGen Locally on Rancher Desktop

Open srace9532 opened this issue 1 year ago • 4 comments

Hello,

Do we have any documents or support to running CDXGen locally using Rancher Desktop?

Currently, I don't see any support in the current repo we can run as a container.

Any helpful links will be greatly appreciated. Thank you!

srace9532 avatar Feb 09 '24 02:02 srace9532

@srace9532, we have container images for cdxgen. We have a long readme page as well as a documentation site. Could you find the image name and give it a try and report how it went?

prabhu avatar Feb 09 '24 02:02 prabhu

Not sure if that's supposed to work out of the box but on my side I had to add the node runtime manually to make it work:

FROM node:22 AS node
FROM ghcr.io/cyclonedx/cdxgen:v10.5.1

...

COPY --from=node /usr/local /opt/node
ENV PATH="/opt/node/bin:${PATH}"
RUN node --version

nekhtan avatar May 29 '24 11:05 nekhtan

@nekhtan, this is due to the use of ENTRYPOINT instead of CMD in our container files

prabhu avatar May 29 '24 12:05 prabhu

@srace9532 I have added support for Rancher Desktop on a mac with this PR. With this change, the npm package can use the nerdctl binary bundled with Rancher Desktop to create container SBOMs. cdxgen container image has always worked under docker, podman, and nerdctl, so I am hoping you managed to get it working already.

prabhu avatar Jul 05 '24 18:07 prabhu