types

package
v0.14.8 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: Apache-2.0 Imports: 15 Imported by: 22

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllArchs = []Architecture{
	_386,
	amd64,
	arm64,
	armv6,
	armv7,
	ppc64le,
	riscv64,
	s390x,
}

AllArchs contains the standard set of supported architectures, which are used by `apko publish` when no architectures are specified.

Functions

This section is empty.

Types

type Architecture added in v0.2.0

type Architecture string

Architecture represents a CPU architecture for the container image. TODO(kaniini): Maybe this should be its own package at this point?

func ParseArchitecture added in v0.2.0

func ParseArchitecture(s string) Architecture

ParseArchitecture parses a single architecture in string form, and returns the equivalent Architecture value.

Any apk-style arch string (e.g., "x86_64") is converted to the OCI-style equivalent ("amd64").

func ParseArchitectures added in v0.2.0

func ParseArchitectures(in []string) []Architecture

ParseArchitectures parses architecture values in string form, and returns the equivalent slice of Architectures.

apk-style arch strings (e.g., "x86_64") are converted to the OCI-style equivalent ("amd64"). Values are deduped, and the resulting slice is sorted for reproducibility.

func (Architecture) Compatible added in v0.2.0

func (a Architecture) Compatible(b Architecture) bool

func (Architecture) String added in v0.2.0

func (a Architecture) String() string

func (Architecture) ToAPK added in v0.2.0

func (a Architecture) ToAPK() string

ToAPK returns the apk-style equivalent string for the Architecture.

func (Architecture) ToOCIPlatform added in v0.2.0

func (a Architecture) ToOCIPlatform() *v1.Platform

func (Architecture) ToQEmu added in v0.2.0

func (a Architecture) ToQEmu() string

func (Architecture) ToRustTriplet added in v0.6.0

func (a Architecture) ToRustTriplet(suffix string) string

func (Architecture) ToTriplet added in v0.6.0

func (a Architecture) ToTriplet(suffix string) string

func (*Architecture) UnmarshalYAML added in v0.3.0

func (a *Architecture) UnmarshalYAML(unmarshal func(interface{}) error) error

type BaseImageDescriptor added in v0.14.1

type BaseImageDescriptor struct {
	// Required: Path to the base image OCI layout. Right now only local files are supported.
	Image string `json:"image,omitempty" yaml:"image,omitempty"`
	// Required: Path to file representing installed packages in the base image in APKINDEX format.
	// (Assumes regular Alpine repository layout, that is: set /foo/bar if the index is /foo/bor/{aarch64|x86_64}/APKINDEX
	APKIndex string `json:"apkindex,omitempty" yaml:"apkindex,omitempty"`
}

type Group added in v0.2.0

type Group struct {
	// Required: The name of the group
	GroupName string `json:"groupname,omitempty"`
	// Required: The group ID
	GID uint32 `json:"gid,omitempty"`
	// Required: The list of members of the group
	Members []string `json:"members,omitempty"`
}

type ImageAccounts added in v0.7.0

type ImageAccounts struct {
	// Required: The user to run the container as. This can be a username or UID.
	RunAs string `json:"run-as,omitempty" yaml:"run-as"`
	// Required: List of users to populate the image with
	Users []User `json:"users,omitempty" yaml:"users"`
	// Required: List of groups to populate the image with
	Groups []Group `json:"groups,omitempty" yaml:"groups"`
}

type ImageConfiguration

type ImageConfiguration struct {
	// Required: The apk packages in the container image
	Contents ImageContents `json:"contents,omitempty" yaml:"contents,omitempty"`
	// Required: The entrypoint of the container image
	//
	// This typically is the path to the executable to run. Since many of
	// images do not include a shell, this should be the full path
	// to the executable.
	Entrypoint ImageEntrypoint `json:"entrypoint,omitempty" yaml:"entrypoint,omitempty"`
	// Optional: The command of the container image
	//
	// These are the additional arguments to pass to the entrypoint.
	Cmd string `json:"cmd,omitempty" yaml:"cmd,omitempty"`
	// Optional: The stop signal used to suspend the execution of the containers process
	StopSignal string `json:"stop-signal,omitempty" yaml:"stop-signal,omitempty"`
	// Optional: The working directory of the container
	WorkDir string `json:"work-dir,omitempty" yaml:"work-dir,omitempty"`
	// Optional: Account configuration for the container image
	Accounts ImageAccounts `json:"accounts,omitempty" yaml:"accounts,omitempty"`
	// Optional: List of CPU architectures to build the container image for
	//
	// The list of supported architectures is: 386, amd64, arm64, arm/v6, arm/v7, ppc64le, riscv64, s390x
	Archs []Architecture `json:"archs,omitempty" yaml:"archs,omitempty"`
	// Optional: Envionment variables to set in the container image
	Environment map[string]string `json:"environment,omitempty" yaml:"environment,omitempty"`
	// Optional: List of paths mutations
	Paths []PathMutation `json:"paths,omitempty" yaml:"paths,omitempty"`
	// Optional: The /etc/os-release configuration for the container image
	OSRelease OSRelease `json:"os-release,omitempty" yaml:"os-release,omitempty"`
	// Optional: The link to version control system for this container's source code
	VCSUrl string `json:"vcs-url,omitempty" yaml:"vcs-url,omitempty"`
	// Optional: Annotations to apply to the images manifests
	Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
	// Optional: Path to a local file containing additional image configuration
	//
	// The included configuration is deep merged with the parent configuration
	Include string `json:"include,omitempty" yaml:"include,omitempty"`

	// Optional: A list of volumes to configure
	//
	// This is _not_ the same as Paths, but refers to the OCI spec "volumes"
	// field used by some container runtimes (docker) to create volumes at
	// runtime. For most use cases, this is not needed, but consider using this
	// when the image requires special volume configuration at runtime for
	// supported container runtimes.
	Volumes []string `json:"volumes,omitempty" yaml:"volumes,omitempty"`
}

func (*ImageConfiguration) Load

func (ic *ImageConfiguration) Load(ctx context.Context, imageConfigPath string, configHasher hash.Hash) error

Load - loads an image configuration given a configuration file path. Populates configHasher with the configuration data loaded from the imageConfigPath and the other referenced files. You can pass any dummy hasher (like fnv.New32()), if you don't care about the hash of the configuration.

func (*ImageConfiguration) ProbeVCSUrl added in v0.5.0

func (ic *ImageConfiguration) ProbeVCSUrl(ctx context.Context, imageConfigPath string)

Attempt to probe an upstream VCS URL if known.

func (*ImageConfiguration) Summarize added in v0.2.0

func (ic *ImageConfiguration) Summarize(ctx context.Context)

func (*ImageConfiguration) Validate

func (ic *ImageConfiguration) Validate() error

Do preflight checks and mutations on an image configuration.

func (*ImageConfiguration) ValidateServiceBundle

func (ic *ImageConfiguration) ValidateServiceBundle() error

Do preflight checks and mutations on an image configured to manage a service bundle.

type ImageContents added in v0.7.0

type ImageContents struct {
	// A list of apk repositories to use for pulling packages
	Repositories []string `json:"repositories,omitempty" yaml:"repositories,omitempty"`
	// A list of public keys used to verify the desired repositories
	Keyring []string `json:"keyring,omitempty" yaml:"keyring,omitempty"`
	// A list of packages to include in the image
	Packages []string `json:"packages,omitempty" yaml:"packages,omitempty"`
	// Optional: Base image to build on top of. Warning: Experimental.
	BaseImage *BaseImageDescriptor `json:"baseimage,omitempty" yaml:"baseimage,omitempty"`
}

func (ImageContents) MarshalYAML added in v0.14.5

func (i ImageContents) MarshalYAML() (interface{}, error)

MarshalYAML implements yaml.Marshaler for ImageContents, redacting URLs in the ImageContents struct fields.

type ImageEntrypoint added in v0.7.0

type ImageEntrypoint struct {
	// Optional: The type of entrypoint. Only "service-bundle" is supported.
	Type string `json:"type,omitempty"`
	// Required: The command of the entrypoint
	Command string `json:"command,omitempty"`
	// Optional: The shell fragment of the entrypoint command
	ShellFragment string `json:"shell-fragment,omitempty" yaml:"shell-fragment"`

	Services map[string]string `json:"services,omitempty"`
}

type OSRelease added in v0.3.0

type OSRelease struct {
	// Optional: The name of the OS
	Name string `json:"name,omitempty"`
	// Optional: The unique identifier for the OS
	ID string `json:"id,omitempty"`
	// Optional: The unique identifier for the version of the OS
	VersionID string `json:"version-id,omitempty" yaml:"version-id"`
	// Optional: The human readable description of the OS
	PrettyName string `json:"pretty-name,omitempty" yaml:"pretty-name"`
	// Optional: The URL of the homepage for the OS
	HomeURL string `json:"home-url,omitempty" yaml:"home-url"`
	// Optional: The URL of the bug reporting website for the OS
	BugReportURL string `json:"bug-report-url,omitempty" yaml:"bug-report-url"`
}

type PathMutation added in v0.3.0

type PathMutation struct {
	// The target path to mutate
	Path string `json:"path,omitempty"`
	// The type of mutation to perform
	//
	// This can be one of: directory, empty-file, hardlink, symlink, permissions
	Type string `json:"type,omitempty"`
	// The mutation's desired user ID
	UID uint32 `json:"uid,omitempty"`
	// The mutation's desired group ID
	GID uint32 `json:"gid,omitempty"`
	// The permission bits for the path
	Permissions uint32 `json:"permissions,omitempty"`
	// The source path to mutate
	Source string `json:"source,omitempty"`
	// Toggle whether to mutate recursively
	Recursive bool `json:"recursive,omitempty"`
}

type SBOM added in v0.9.0

type SBOM struct {
	Arch   string
	Path   string
	Format string
	Digest v1.Hash
}

type User added in v0.2.0

type User struct {
	// Required: The name of the user
	UserName string `json:"username,omitempty"`
	// Required: The user ID
	UID uint32 `json:"uid,omitempty"`
	// Required: The user's group ID
	GID uint32 `json:"gid,omitempty"`
	// Optional: The user's shell
	Shell string `json:"shell,omitempty"`
	// Optional: The user's home directory
	HomeDir string `json:"homedir,omitempty"`
}

Jump to

Keyboard shortcuts

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