Oci

Developer reference: this page includes exported implementation details. BUILD authors should prefer the User API reference.

ociPull

const ociPull

Declare an OCI image pull label: fetches repo:tag (or repo@digest) into the shared oci-storage named cache as an OCI-layout directory, for use as an ociBuild() base or an ociPush() source.

ParameterTypeDescription
optsobject
opts.repostringImage repository, e.g. "docker.io/library/alpine" or "ghcr.io/org/image".
[opts.tag]stringMutable tag — resolved to a digest at build time via crane digest.
[opts.digest]stringImmutable sha256:... digest — skips the resolve step entirely.

Returns: object Exported label handle.

ociPullBuild

const ociPullBuild

Resolve/pull an ociPull() label: an immutable digest, resolved once (impurely — a tag can move) if only a tag was given, then a cached fetch of that digest's OCI-layout directory into oci-storage.

ParameterTypeDescription
handleobjectLabel handle returned by ociPull().

Returns: Promise<{ ociLayoutPath: string, digest: string }>

ociPullPackage

const ociPullPackage

Package an ociPull() label: writes the pulled image's OCI-layout directory out as a dist/.../image.tar oci-archive tarball, loadable via podman load / docker load. will contain an image.tar.

ParameterTypeDescription
handleobjectLabel handle returned by ociPull().

Returns: Promise<object> An artifact(...) whose published dist/ path

ociBuild

const ociBuild

Declare an OCI image build label: composes base plus layers into a new image by hand-assembling its OCI layout (layer blobs, config blob, manifest blob, index.json) — no Dockerfile, no commands executed inside a container. One or more file-staging specs; each becomes one deterministic layer tarball. Deliberately no platforms/multi-arch surface yet — single-manifest only for this pass. When multi-arch support is added, it attaches here (an OCI index assembled via crane index append over one build per platform) without needing to change layers'/base's shape.

ParameterTypeDescription
optsobject
[opts.path="."]stringDirectory (relative to the declaring BUILD.js) layers[].srcs glob against.
opts.baseobject"scratch"
opts.layersArray<{srcs: string[], path: string, exclude?: string[], uid?: number, gid?: number, mode?: string}>
[opts.entrypoint]string[]Image ENTRYPOINT.
[opts.cmd]string[]Image CMD.
[opts.env]Record<string,string>Image environment variables.
[opts.labels]Record<string,string>Image labels.
[opts.user]stringImage USER.
[opts.workdir]stringImage WORKDIR.

Returns: object Exported label handle.

ociBuildBuild

const ociBuildBuild

Undocumented.

ociBuildPackage

const ociBuildPackage

Package an ociBuild() label: writes the composed image's OCI-layout directory out as a dist/.../image.tar oci-archive tarball, loadable via podman load / docker load. will contain an image.tar.

ParameterTypeDescription
handleobjectLabel handle returned by ociBuild().

Returns: Promise<object> An artifact(...) whose published dist/ path

ociPush

const ociPush

Declare an OCI image push label: publishes an ociPull()/ociBuild() image to repo:tag.

ParameterTypeDescription
optsobject
opts.imageobjectAn ociPull()/ociBuild() label handle.
opts.repostringDestination repository.
opts.tagstringDestination tag.

Returns: object Exported label handle.

ociPushBuild

const ociPushBuild

Undocumented.

ociMirror

const ociMirror

Declare an OCI mirror label: re-hosts an image from one registry ref to another via crane copy (registry-to-registry, no local disk materialization) — e.g. mirroring a public upstream image into an internal registry without a Dockerfile.

ParameterTypeDescription
optsobject
opts.fromobjectSource ref: { repo, tag } or { repo, digest }.
opts.toobjectDestination ref: { repo, tag }.

Returns: object Exported label handle.

ociMirrorBuild

const ociMirrorBuild

Undocumented.