container

package
v0.37.1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2025 License: Apache-2.0 Imports: 43 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// DefaultWorkspaceDir is the default path to the workspace directory in the runner's environment.
	DefaultWorkspaceDir = "/home/build"
	// DefaultCacheDir is the default path to the cache directory in the runner's environment.
	DefaultCacheDir = "/var/cache/melange"
	// DefaultResolvConfPath is the default path to the resolv.conf file in the runner's environment.
	DefaultResolvConfPath = "/etc/resolv.conf"
)
View Source
const (
	KB = 1 << (10 * iota)
	MB
	GB
	TB
)

Use binary values for all units

View Source
const (
	BubblewrapName = "bubblewrap"
)
View Source
const QemuName = "qemu"

Variables

This section is empty.

Functions

This section is empty.

Types

type BindMount

type BindMount struct {
	Source      string
	Destination string
}

type Capabilities

type Capabilities struct {
	Networking bool
	Add        []string // List of kernel capabilities to add to the container.
	Drop       []string // List of kernel capabilities to drop from the container.
}

type Config

type Config struct {
	PackageName              string
	Mounts                   []BindMount
	Capabilities             Capabilities
	Environment              map[string]string
	ImgRef                   string
	PodID                    string
	Arch                     apko_types.Architecture
	RunAsUID                 string
	RunAs                    string
	WorkspaceDir             string
	CacheDir                 string
	CPU, CPUModel, Memory    string
	SSHKey                   ssh.Signer
	SSHAddress               string             // SSH address for the build / chrooted environment
	SSHControlAddress        string             // SSH address for the control / management environment
	SSHHostKey               string             // Path to known_hosts file containing the VM's host key
	VMHostKeySigner          ssh.Signer         // VM's SSH host key (private signer)
	VMHostKeyPublic          ssh.PublicKey      // VM's SSH host key (public) - for verification
	VMHostKeyPrivateKeyBytes []byte             // VM's SSH host key (raw private key bytes) - for injection
	VMHostKeyPrivate         ed25519.PrivateKey // VM's SSH host key (raw private key) - for explicit zeroing
	InitramfsPath            string             // Path to temp initramfs file (contains sensitive key material)
	Disk                     string
	Timeout                  time.Duration
	SSHBuildClient           *ssh.Client // SSH client for the build environment, may not have privileges
	SSHControlBuildClient    *ssh.Client // SSH client for control operations in the build environment, has privileges
	SSHControlClient         *ssh.Client // SSH client for unrestricted control environment, has privileges
	QemuPID                  int
	RunAsGID                 string
}

type Debugger added in v0.6.0

type Debugger interface {
	Debug(ctx context.Context, cfg *Config, envOverride map[string]string, cmd ...string) error
}

type Loader added in v0.4.0

type Loader interface {
	LoadImage(ctx context.Context, layer v1.Layer, arch apko_types.Architecture, bc *apko_build.Context) (ref string, err error)
	RemoveImage(ctx context.Context, ref string) error
}

type Runner