Skip to content

[wip] layer_from_pkg#523

Draft
peakschris wants to merge 1 commit into
bazel-contrib:mainfrom
peakschris:cb_image_from_pkg
Draft

[wip] layer_from_pkg#523
peakschris wants to merge 1 commit into
bazel-contrib:mainfrom
peakschris:cb_image_from_pkg

Conversation

@peakschris
Copy link
Copy Markdown

@peakschris peakschris commented May 16, 2026

Closes #188.

Adds layer_from_pkg to //img:layer.bzl, which converts rules_pkg packaging manifests into OCI image layers. It accepts PackageFilesInfo, PackageFilegroupInfo, PackageSymlinkInfo, and PackageDirsInfo from rules_pkg_providers — a lightweight BCR module whose only dependency is rules_license, so rules_pkg itself is not pulled in as a transitive dependency of rules_img.

layer_from_pkg(
    name = "app_layer",
    srcs = [":app_pkg"],  # pkg_filegroup, pkg_files, pkg_mklink, pkg_mkdirs
)

Waiting on rules_pkg

rules_pkg 1.2.0 has not yet migrated to emit rules_pkg_providers providers — it still defines them inline. Until a new rules_pkg release adopts rules_pkg_providers, targets built with pkg_files / pkg_filegroup cannot be passed to layer_from_pkg directly.

For now, the e2e tests work around this with fake_pkg_* fixtures that mirror the rules_pkg API but emit providers from rules_pkg_providers directly. These fixtures can be replaced with real rules_pkg targets once that migration lands.

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.

Accept rules_pkg manifests as input for image_layer

1 participant