Add Docker archive support to Linux scanner#1711
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for scanning Docker archive images (tarballs produced by docker save) in the Linux container detector by recognizing a new docker-archive: image reference prefix and routing it through the existing “local image” scanning flow.
Changes:
- Add
ImageReferenceKind.DockerArchiveand parsedocker-archive:inputs inImageReference.Parse. - Treat Docker archives as local image inputs in
LinuxContainerDetectorand invoke Syft with adocker-archive:source. - Add detector documentation and a unit test covering Docker archive scanning.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| test/Microsoft.ComponentDetection.Detectors.Tests/LinuxContainerDetectorTests.cs | Adds a unit test verifying Docker archive inputs are scanned and mapped into recorded components. |
| src/Microsoft.ComponentDetection.Detectors/linux/LinuxContainerDetector.cs | Routes DockerArchive through local-image validation and constructs the Syft source string for docker-archive scanning. |
| src/Microsoft.ComponentDetection.Detectors/linux/ImageReference.cs | Introduces DockerArchive kind and parses the docker-archive: prefix. |
| docs/detectors/linux.md | Documents docker-archive: usage under supported input formats. |
src/Microsoft.ComponentDetection.Detectors/linux/LinuxContainerDetector.cs
Show resolved
Hide resolved
src/Microsoft.ComponentDetection.Detectors/linux/LinuxContainerDetector.cs
Show resolved
Hide resolved
src/Microsoft.ComponentDetection.Detectors/linux/LinuxContainerDetector.cs
Show resolved
Hide resolved
|
👋 Hi! It looks like you modified some files in the
If none of the above scenarios apply, feel free to ignore this comment 🙂 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1711 +/- ##
============================
============================
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This reverts commit d6c5db9.
Adds support for scanning Docker archive images (tarballs created by
docker save) in the Linux container detector. Builds on #1708