container

package
v0.0.0-...-a981527 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 17, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package container provides container image building via docker, podman, or buildah.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Verify

func Verify(ctx context.Context, imageTag string) error

Verify performs a smoke test on a built container image. It starts the container, waits for startup, checks /healthz and /.well-known/agent.json, then stops and removes the container.

func WriteManifest

func WriteManifest(path string, m *ImageManifest) error

WriteManifest writes the image manifest as JSON to the given path.

Types

type BuildOptions

type BuildOptions struct {
	ContextDir string
	Dockerfile string
	Tag        string
	Platform   string
	NoCache    bool
	BuildArgs  map[string]string
}

BuildOptions configures a container image build.

type BuildResult

type BuildResult struct {
	ImageID string
	Tag     string
	Size    int64
}

BuildResult holds the result of a container image build.

type BuildahBuilder

type BuildahBuilder struct{}

BuildahBuilder builds container images using the buildah CLI.

func (*BuildahBuilder) Available

func (b *BuildahBuilder) Available() bool

func (*BuildahBuilder) Build

func (b *BuildahBuilder) Build(ctx context.Context, opts BuildOptions) (*BuildResult, error)

func (*BuildahBuilder) Name

func (b *BuildahBuilder) Name() string

func (*BuildahBuilder) Push

func (b *BuildahBuilder) Push(ctx context.Context, image string) error

type Builder

type Builder interface {
	Build(ctx context.Context, opts BuildOptions) (*BuildResult, error)
	Push(ctx context.Context, image string) error
	Available() bool
	Name() string
}

Builder is the interface for container image builders.

func Detect

func Detect() Builder

Detect returns the first available container builder in order: docker, podman, buildah. Returns nil if no builder is available.

func Get

func Get(name string) Builder

Get returns a builder by name, or nil if the name is unknown.

type DockerBuilder

type DockerBuilder struct{}

DockerBuilder builds container images using the docker CLI.

func (*DockerBuilder) Available

func (b *DockerBuilder) Available() bool

func (*DockerBuilder) Build

func (b *DockerBuilder) Build(ctx context.Context, opts BuildOptions) (*BuildResult, error)

func (*DockerBuilder) Name

func (b *DockerBuilder) Name() string

func (*DockerBuilder) Push

func (b *DockerBuilder) Push(ctx context.Context, image string) error

type ImageManifest

type ImageManifest struct {
	AgentID  string `json:"agent_id"`
	Version  string `json:"version"`
	ImageTag string `json:"image_tag"`
	Builder  string `json:"builder"`
	Platform string `json:"platform,omitempty"`
	BuiltAt  string `json:"built_at"`
	BuildDir string `json:"build_dir"`
	Pushed   bool   `json:"pushed"`

	// Container packaging extensions
	ForgeVersion         string         `json:"forge_version,omitempty"`
	ToolInterfaceVersion string         `json:"tool_interface_version,omitempty"`
	SkillsSpecVersion    string         `json:"skills_spec_version,omitempty"`
	SkillsCount          int            `json:"skills_count,omitempty"`
	EgressProfile        string         `json:"egress_profile,omitempty"`
	EgressMode           string         `json:"egress_mode,omitempty"`
	AllowedDomainsCount  int            `json:"allowed_domains_count,omitempty"`
	DevBuild             bool           `json:"dev_build,omitempty"`
	ToolCategories       map[string]int `json:"tool_categories,omitempty"`
}

ImageManifest records metadata about a built container image.

func ReadManifest

func ReadManifest(path string) (*ImageManifest, error)

ReadManifest reads an image manifest from the given path.

type PodmanBuilder

type PodmanBuilder struct{}

PodmanBuilder builds container images using the podman CLI.

func (*PodmanBuilder) Available

func (b *PodmanBuilder) Available() bool

func (*PodmanBuilder) Build

func (b *PodmanBuilder) Build(ctx context.Context, opts BuildOptions) (*BuildResult, error)

func (*PodmanBuilder) Name

func (b *PodmanBuilder) Name() string

func (*PodmanBuilder) Push

func (b *PodmanBuilder) Push(ctx context.Context, image string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL