rules
Public API re-exports
apko_image
apko_image(name, architecture, args, config, contents, output, tag)
Build OCI images from APK packages directly without Dockerfile
This rule creates Alpine images using the 'apko.yaml' configuration file and relies on cache contents generated by translate_lock to be fast.
apko_image(
name = "example",
config = "apko.yaml",
contents = "@example_lock//:contents",
tag = "example:latest",
)
The label @example_lock//:contents
is generated by the translate_lock
extension, which consumes an 'apko.resolved.json' file.
For more details, refer to the documentation.
An example demonstrating usage with rules_oci
apko_image(
name = "alpine_base",
config = "apko.yaml",
contents = "@alpine_base_lock//:contents",
tag = "alpine_base:latest",
)
oci_image(
name = "app",
base = ":alpine_base"
)
For more examples checkout the examples directory.
ATTRIBUTES
Name | Description | Type | Mandatory | Default |
---|---|---|---|---|
name | A unique name for this target. | Name | required | |
architecture | the CPU architecture which this image should be built to run on. See https://github.com/chainguard-dev/apko/blob/main/docs/apko_file.md#archs-top-level-element | String | optional | "" |
args | additional arguments to provide when running the apko build command. | List of strings | optional | [] |
config | Label to the apko.yaml file. | Label | required | |
contents | Label to the contents repository generated by translate_lock. See apko-cache documentation. | Label | required | |
output | - | String | optional | "oci" |
tag | tag to apply to the resulting docker tarball. only applicable when output is docker | String | required |
apko_bazelrc
apko_bazelrc(name, repositories, kwargs)
Helper macro for generating .bazelrc
and range.sh
files to allow for partial package fetches.
See initial setup documentation for more information.
PARAMETERS