public API
load("@rules_oci//oci:defs.bzl", "oci_image_config")
oci_image_config(name, arch, image, os)
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this target. | Name | required | |
| arch | Used to extract config from image if image is an index | String | optional | "" |
| image | - | Label | required | |
| os | Used to extract config from image if image is an index | String | optional | "" |
load("@rules_oci//oci:defs.bzl", "oci_image_index")
oci_image_index(name, annotations, manifests)
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this target. | Name | required | |
| annotations | - | Dictionary: String -> String | optional | {} |
| manifests | - | List of labels | optional | [] |
load("@rules_oci//oci:defs.bzl", "oci_image_layout")
oci_image_layout(name, manifest)
Writes an OCI Image Index and related blobs to an OCI Image Format directory. See https://github.com/opencontainers/image-spec/blob/main/image-layout.md for the specification of the OCI Image Format directory.
All blobs must be provided in the manifest's OCILayout provider, in the files attribute. If blobs are missing, creation of the OCI Image Layout will fail.
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this target. | Name | required | |
| manifest | An OCILayout index to be written to the OCI Image Format directory. | Label | optional | None |
load("@rules_oci//oci:defs.bzl", "oci_push")
oci_push(name, headers, manifest, registry, repository, stamp, tag, x_meta_headers)
Pushes a manifest or a list of manifests to an OCI registry.
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this target. | Name | required | |
| headers | (optional) A list of key/values to to be sent to the registry as headers. | Dictionary: String -> String | optional | {} |
| manifest | A manifest to push to a registry. If an OCILayout index, then push all artifacts with a 'org.opencontainers.image.ref.name' annotation. | Label | optional | None |
| registry | A registry host to push to, if not present consult the toolchain. | String | optional | "" |
| repository | A repository to push to, if not present consult the toolchain. | String | optional | "" |
| stamp | Whether to encode build information into the output. Possible values: - stamp = 1: Always stamp the build information into the output, even in --nostamp builds. This setting should be avoided, since it is non-deterministic. It potentially causes remote cache misses for the target and any downstream actions that depend on the result. - stamp = 0: Never stamp, instead replace build information by constant values. This gives good build result caching. - stamp = -1: Embedding of build information is controlled by the --[no]stamp flag. Stamped targets are not rebuilt unless their dependencies change. |
Integer | optional | -1 |
| tag | (optional) A tag to include in the target reference. This will not be included on child images. Subject to $(location) and "Make variable" substitution. Stamping You can use values produced by the workspace status command in your tag. To do this write a script that prints key-value pairs separated by spaces, e.g. You can reference these keys in tag using curly braces, |
String | optional | "" |
| x_meta_headers | (optional) A list of key/values to to be sent to the registry as headers with an X-Meta- prefix. | Dictionary: String -> String | optional | {} |
load("@rules_oci//oci:defs.bzl", "generate_config_file_action")
generate_config_file_action(ctx, config_file, image, os, arch)
Generates a run action with that extracts an image's config file.
In order to use this action, the calling rule must register
@com_github_datadog_rules_oci//oci:toolchain and the image
must provide the OCIDescriptor and OCILayout (this should
not be an issue when using the oci_image rule).
PARAMETERS
RETURNS
The config file named after the rule, os, and arch
load("@rules_oci//oci:defs.bzl", "oci_image")
oci_image(name, base, annotations, arch, cmd, entrypoint, env, labels, layers, os, tars, kwargs)
oci_image
Creates a new image manifest and config by appending the layers to an
existing image manifest and config defined by base. If base is an image
index, then os and arch will be used to extract the image manifest.
PARAMETERS
load("@rules_oci//oci:defs.bzl", "oci_image_layer")
oci_image_layer(name, directory, files, file_map, mode_map, owner_map, symlinks, compression_method,
kwargs)
Creates a tarball and an OCI descriptor for it
PARAMETERS
load("@rules_oci//oci:defs.bzl", "oci_pull")
oci_pull(name, debug, digest, registry, repo_mapping, repository, shallow)
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this repository. | Name | required | |
| debug | Enable ocitool debug output | Boolean | optional | False |
| digest | - | String | required | |
| registry | - | String | required | |
| repo_mapping | In WORKSPACE context only: a dictionary from local repository name to global repository name. This allows controls over workspace dependency resolution for dependencies of this repository.For example, an entry "@foo": "@bar" declares that, for any time this repository depends on @foo (such as a dependency on @foo//some:target, it should actually resolve that dependency within globally-declared @bar (@bar//some:target).This attribute is not supported in MODULE.bazel context (when invoking a repository rule inside a module extension's implementation function). |
Dictionary: String -> String | optional | |
| repository | - | String | required | |
| shallow | - | Boolean | optional | True |
ENVIRONMENT VARIABLES
This repository rule depends on the following environment variables:
OCI_CACHE_DIR