Docker Parser: Containerfile and OCI Label Support
March 19, 2026 ยท View on GitHub
Summary
โจ New Feature + ๐ Enhanced Extraction: Rust recognizes both Dockerfile and Containerfile as package data files, extracts OCI image labels from them, and keeps those results attached to the file itself instead of forcing sibling assembly.
Reference limitation
The Python reference does not provide a normal packagedcode Docker parser that covers this behavior directly. As a result, Dockerfile-like files are easier to miss as package metadata sources.
Rust improvement
Rust implements three durable behaviors:
-
Dockerfile and Containerfile recognition Alternative Dockerfile names such as
Containerfileare treated as package data instead of being ignored. -
OCI label extraction
LABEL org.opencontainers.image.*=...instructions are mapped into normal package metadata when they fit existing fields, and the full label set is preserved inextra_data.oci_labelsso label data is not lost. -
Non-assembled package data behavior Dockerfile and Containerfile results stay attached to the file that declared them. That keeps the behavior predictable and avoids introducing unnecessary sibling-merge semantics.
Why this matters
- Alternative naming support:
Containerfileprojects are no longer invisible to package detection - Container metadata visibility: OCI labels produce structured package metadata instead of disappearing into plain text
- Safer scope control: scan output can include container metadata without inventing unrelated assembly rules