bazel-contrib / rules_oci

Bazel rules for building OCI containers
Apache License 2.0
302 stars 158 forks source link

Document output of oci_image more clearly #668

Open reddaly opened 3 months ago

reddaly commented 3 months ago

The output of an oci_image and oci_image_rule is not clearly documented.

The only reference to the output as of today (taken from here) is

Produces a target [name].digest, whose default output is a file containing the sha256 digest of the resulting image. This is similar to the same-named target created by rules_docker's container_image macro.


The output of the rule seems to be a directory. When I inspect the directory, I don't see much content. I would have expected to single file with an image file I could run though crane export <image> <image.tar> so I can inspect the file system contents of the image.

thesayyn commented 3 months ago

Output of an oci_image is an OCI Image Layout which is defined by the oci-spec.

reddaly commented 3 months ago

Thanks. Adding that sentence to the docstring for oci_image and oci_image_rule is pretty much all I'm looking for.

It might also be worth giving a pointer to guide that explains how to consume the image with other tools. For example, how can a rules_oci output directory be used by docker, e.g. the docker load command,

thesayyn commented 1 month ago

I'd be happy review a PR :)

For example, how can a rules_oci output directory be used by docker

https://github.com/bazel-contrib/rules_oci/blob/main/docs/load.md