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 ¶
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 ¶
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
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.
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
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