Documentation
¶
Overview ¶
Package containerbuild provides the implementation of the ContainerBuild command, which builds a container image from a Dockerfile and tags it with the provided name and tags.
Package containerbuild implements the "build" subcommand, which builds an OCI image using the docker CLI.
Index ¶
- func Action(ctx context.Context, cmd *cli.Command) error
- func Command() *cli.Command
- func EmbeddedResolver() IOE.IOEither[error, DockerfileResource]
- func Execute(r Input) IOE.IOEither[error, F.Void]
- func FileResolver(path string) IOE.IOEither[error, DockerfileResource]
- func ValidateInput(r Input) E.Either[error, Input]
- type CommandSpec
- type DockerfileResource
- type Input
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Action ¶
Action is the build subcommand entry point. Pipeline: validate tags → acquire dockerfile → render args → run process → release.
func EmbeddedResolver ¶
func EmbeddedResolver() IOE.IOEither[error, DockerfileResource]
EmbeddedResolver writes the compile-time embedded Dockerfile content to a temp file and returns a DockerfileResource whose Release removes that file.
func Execute ¶
Execute orchestrates the full build lifecycle using ioeither.WithResource. Delegates to executeWith for testability.
func FileResolver ¶
func FileResolver(path string) IOE.IOEither[error, DockerfileResource]
FileResolver validates that path is non-blank, then wraps it in a DockerfileResource with nop cleanup.
Types ¶
type CommandSpec ¶
CommandSpec holds the resolved executable binary and argv slice. Built inside Execute after the DockerfileResource is acquired.
func RenderCommand ¶
func RenderCommand(r Input, path string) CommandSpec
RenderCommand is a pure function that builds a CommandSpec from an Input and a resolved Dockerfile path. Called inside Execute after the DockerfileResource is acquired.
type DockerfileResource ¶
DockerfileResource pairs a resolved Dockerfile path with its cleanup IOEither. For file-based builds cleanup is a nop; for embedded builds it removes the temp file via IOEF.Remove.
type Input ¶
type Input struct {
DockerfileSource IOE.IOEither[error, DockerfileResource]
Name string
Tags []string
BuildArgs map[string]string
Ctx context.Context
}
Input holds the build parameters throughout the pipeline. DockerfileSource is a lazy IOEither that resolves to a DockerfileResource when executed. It is set once in InputFromCommand and never branched on.