Documentation
¶
Overview ¶
Package apko implements image.Composer by invoking the pinned apko binary.
New builds an adapter that shells out to `apko lock` and then `apko build` in the request working directory. The adapter performs no lockfile or layout reasoning of its own: configuration, repository, keyring, lock, SBOM, layout, reference, architectures, and annotations come from the request. Both invocations run with [exec.Cmd.Dir] set to request.Dir; every other path the child receives is request-relative.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Composer ¶
type Composer struct {
// contains filtered or unexported fields
}
Composer invokes the apko CLI to lock a configuration and write a multi-architecture OCI layout.
It implements image.Composer. It performs no lockfile or layout inspection of its own.
func New ¶
New constructs a Composer from options.
Path resolution is deferred until Composer.Build so a missing binary is reported when composing, not at construction.
func (*Composer) Build ¶
Build implements image.Composer.
It runs `apko lock` and then `apko build` as explicit argument slices through execx.Run, both with the child working directory set to request.Dir. Architecture flags follow image.ComposeRequest.Arches in order. Annotation flags follow image.ComposeRequest.Annotations in order. A nil context, a nil receiver, an empty required request field, an empty Arches slice, an empty architecture entry, or an annotation with an empty key is rejected before any process starts. A nonzero exit returns an error that names the apko subcommand, the exit code, and a bounded tail of stderr. Both invocations discard stdout.
type Options ¶
type Options struct {
// Path is the apko executable. An empty path resolves "apko" from
// PATH with [exec.LookPath] when composing.
Path string
// Environ is the child process environment. A nil value inherits
// [os.Environ]. The slice is used as-is and is never logged.
Environ []string
// Stderr receives apko diagnostics while the process runs. A nil
// value discards them. A nonzero exit still captures a bounded tail
// for the returned error.
Stderr io.Writer
}
Options configures a Composer.