Skip to content

Conversation

@lirshindalman
Copy link
Contributor

This MR updates the cdxgen-alpine-ruby34 Docker image by adding the ruby-dev and build-base packages.

Motivation:
Previously, running bundle install or generating a Gemfile.lock inside the Alpine-based image would fail due to missing build tools and development headers. This prevented accurate dependency scanning for Ruby projects, especially when a Gemfile.lock is not present.

Changes:
Added ruby-dev and build-base to the Alpine image.
This enables proper compilation of native extensions required by gems like date, nio4r, and websocket-driver.
Allows cdxgen to scan Ruby projects and generate SBOMs reliably, even in projects without an existing lock file.

Impact:
Users can now run CDXGen on Ruby projects in the Alpine image without encountering build failures.
Ruby dependency resolution and SBOM generation are accurate and complete.
Minimal change to the existing image: only the required development packages are added.

Testing:
Verified bundle install runs successfully inside the updated image.
Generated SBOMs include all Ruby dependencies, including those that require native compilation.

@lirshindalman lirshindalman force-pushed the support_generate_ruby_lock_alpine branch from cc9302d to 1555929 Compare November 20, 2025 13:40
@malice00
Copy link
Collaborator

Is there a reason you didn't just add these to packages to the existing apk add command?

@malice00 malice00 merged commit f2cb0c7 into CycloneDX:master Nov 22, 2025
6 checks passed
@lirshindalman
Copy link
Contributor Author

hi @malice00 thanks for the response and the merge.
I assume you wanted to create an image that’s as slim as possible. The thing is, this approach didn’t support generating the lock file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants