Dagger
Search

apko

Build container images from apk packages.

Installation

dagger install github.com/sagikazarmark/daggerverse/apko@v0.1.0

Entrypoint

Return Type
Apko !
Arguments
NameTypeDescription
containerContainer Custom container to use as a base container.
withoutCacheBoolean Disable mounting a default cache volume.
Example
func (m *myModule) example() *Apko  {
	return dag.
			Apko()
}
@function
def example() -> dag.Apko:
	return (
		dag.apko()
	)
@func()
example(): Apko {
	return dag
		.apko()
}

Types

Apko 🔗

withCache() 🔗

Mount a cache volume for apk cache.

Return Type
Apko !
Arguments
NameTypeDefault ValueDescription
cacheCacheVolume !-No description provided
sourceDirectory -Identifier of the directory to use as the cache volume's root.
sharingScalar -Sharing mode of the cache volume.
Example
func (m *myModule) example(cache *CacheVolume) *Apko  {
	return dag.
			Apko().
			WithCache(cache)
}
@function
def example(cache: dagger.CacheVolume) -> dag.Apko:
	return (
		dag.apko()
		.with_cache(cache)
	)
@func()
example(cache: CacheVolume): Apko {
	return dag
		.apko()
		.withCache(cache)
}

withRegistryAuth() 🔗

Add credentials for a registry.

Return Type
Apko !
Arguments
NameTypeDefault ValueDescription
addressString !-No description provided
usernameString !-No description provided
secretSecret !-No description provided
Example
func (m *myModule) example(address string, username string, secret *Secret) *Apko  {
	return dag.
			Apko().
			WithRegistryAuth(address, username, secret)
}
@function
def example(address: str, username: str, secret: dagger.Secret) -> dag.Apko:
	return (
		dag.apko()
		.with_registry_auth(address, username, secret)
	)
@func()
example(address: string, username: string, secret: Secret): Apko {
	return dag
		.apko()
		.withRegistryAuth(address, username, secret)
}

withoutRegistryAuth() 🔗

Removes credentials for a registry.

Return Type
Apko !
Arguments
NameTypeDefault ValueDescription
addressString !-No description provided
Example
func (m *myModule) example(address string) *Apko  {
	return dag.
			Apko().
			WithoutRegistryAuth(address)
}
@function
def example(address: str) -> dag.Apko:
	return (
		dag.apko()
		.without_registry_auth(address)
	)
@func()
example(address: string): Apko {
	return dag
		.apko()
		.withoutRegistryAuth(address)
}

build() 🔗

Build an image from a YAML configuration file.

Return Type
BuildResult !
Arguments
NameTypeDefault ValueDescription
configFile !-Configuration file.
tagString !-Image tag.
lockfileFile -A .lock.json file (e.g. produced by apko lock) that constraints versions of packages to the listed ones.
annotations[String ! ] -OCI annotations to add. Separate with colon (key:value).
arch[String ! ] -Architectures to build for (e.g., x86_64,ppc64le,arm64) -- default is all, unless specified in config. Can also use 'host' to indicate arch of host this is running on.
buildDateString -Date used for the timestamps of the files inside the image in RFC3339 format.
keyringAppend[String ! ] -Path to extra keys to include in the keyring.
offlineBoolean -Do not use network to fetch packages (cache must be pre-populated).
packageAppend[String ! ] -Extra packages to include.
repositoryAppend[String ! ] -Path to extra repositories to include.
vcsBoolean trueDetect and embed VCS URLs.
Example
func (m *myModule) example(config *File, tag string) *ApkoBuildResult  {
	return dag.
			Apko().
			Build(config, tag)
}
@function
def example(config: dagger.File, tag: str) -> dag.ApkoBuildResult:
	return (
		dag.apko()
		.build(config, tag)
	)
@func()
example(config: File, tag: string): ApkoBuildResult {
	return dag
		.apko()
		.build(config, tag)
}

publish() 🔗

Publish a built image from a YAML configuration file.

Return Type
Void !
Arguments
NameTypeDefault ValueDescription
configFile !-Configuration file.
tagString !-Image tag.
annotations[String ! ] -OCI annotations to add. Separate with colon (key:value).
arch[String ! ] -Architectures to build for (e.g., x86_64,ppc64le,arm64) -- default is all, unless specified in config. Can also use 'host' to indicate arch of host this is running on.
buildDateString -Date used for the timestamps of the files inside the image in RFC3339 format.
keyringAppend[String ! ] -Path to extra keys to include in the keyring.
offlineBoolean -Do not use network to fetch packages (cache must be pre-populated).
packageAppend[String ! ] -Extra packages to include.
repositoryAppend[String ! ] -Path to extra repositories to include.
vcsBoolean trueDetect and embed VCS URLs.
Example
func (m *myModule) example(ctx context.Context, config *File, tag string)   {
	return dag.
			Apko().
			Publish(ctx, config, tag)
}
@function
async def example(config: dagger.File, tag: str) -> None:
	return await (
		dag.apko()
		.publish(config, tag)
	)
@func()
async example(config: File, tag: string): Promise<void> {
	return dag
		.apko()
		.publish(config, tag)
}

wolfi() 🔗

Load the Wolfi base configuration.

Return Type
Config !
Example
func (m *myModule) example() *ApkoConfig  {
	return dag.
			Apko().
			Wolfi()
}
@function
def example() -> dag.ApkoConfig:
	return (
		dag.apko()
		.wolfi()
	)
@func()
example(): ApkoConfig {
	return dag
		.apko()
		.wolfi()
}

alpine() 🔗

Load the Alpine base configuration.

Return Type
Config !
Example
func (m *myModule) example() *ApkoConfig  {
	return dag.
			Apko().
			Alpine()
}
@function
def example() -> dag.ApkoConfig:
	return (
		dag.apko()
		.alpine()
	)
@func()
example(): ApkoConfig {
	return dag
		.apko()
		.alpine()
}

preset() 🔗

Load a configuration preset.

Return Type
Config !
Arguments
NameTypeDefault ValueDescription
nameString !-No description provided
Example
func (m *myModule) example(name string) *ApkoConfig  {
	return dag.
			Apko().
			Preset(name)
}
@function
def example(name: str) -> dag.ApkoConfig:
	return (
		dag.apko()
		.preset(name)
	)
@func()
example(name: string): ApkoConfig {
	return dag
		.apko()
		.preset(name)
}

config() 🔗

Load a configuration file.

Return Type
Config !
Arguments
NameTypeDefault ValueDescription
fileFile !-No description provided
Example
func (m *myModule) example(file *File) *ApkoConfig  {
	return dag.
			Apko().
			Config(file)
}
@function
def example(file: dagger.File) -> dag.ApkoConfig:
	return (
		dag.apko()
		.config(file)
	)
@func()
example(file: File): ApkoConfig {
	return dag
		.apko()
		.config(file)
}

BuildResult 🔗

file() 🔗

Return Type
File !
Example
func (m *myModule) example(file *File, tag string) *File  {
	return dag.
			Apko().
			Config(file).
			Build(tag).
			File()
}
@function
def example(file: dagger.File, tag: str) -> dagger.File:
	return (
		dag.apko()
		.config(file)
		.build(tag)
		.file()
	)
@func()
example(file: File, tag: string): File {
	return dag
		.apko()
		.config(file)
		.build(tag)
		.file()
}

tag() 🔗

Return Type
String !
Example
func (m *myModule) example(ctx context.Context, file *File, tag string) string  {
	return dag.
			Apko().
			Config(file).
			Build(tag).
			Tag(ctx)
}
@function
async def example(file: dagger.File, tag: str) -> str:
	return await (
		dag.apko()
		.config(file)
		.build(tag)
		.tag()
	)
@func()
async example(file: File, tag: string): Promise<string> {
	return dag
		.apko()
		.config(file)
		.build(tag)
		.tag()
}

asContainer() 🔗

Import the image into a container.

Return Type
Container !
Example
func (m *myModule) example(file *File, tag string) *Container  {
	return dag.
			Apko().
			Config(file).
			Build(tag).
			AsContainer()
}
@function
def example(file: dagger.File, tag: str) -> dagger.Container:
	return (
		dag.apko()
		.config(file)
		.build(tag)
		.as_container()
	)
@func()
example(file: File, tag: string): Container {
	return dag
		.apko()
		.config(file)
		.build(tag)
		.asContainer()
}

Config 🔗

file() 🔗

Return Type
File !
Example
func (m *myModule) example(file *File) *File  {
	return dag.
			Apko().
			Config(file).
			File()
}
@function
def example(file: dagger.File) -> dagger.File:
	return (
		dag.apko()
		.config(file)
		.file()
	)
@func()
example(file: File): File {
	return dag
		.apko()
		.config(file)
		.file()
}

repositories() 🔗

Return Type
[String ! ] !
Example
func (m *myModule) example(ctx context.Context, file *File) []string  {
	return dag.
			Apko().
			Config(file).
			Repositories(ctx)
}
@function
async def example(file: dagger.File) -> List[str]:
	return await (
		dag.apko()
		.config(file)
		.repositories()
	)
@func()
async example(file: File): Promise<string[]> {
	return dag
		.apko()
		.config(file)
		.repositories()
}

keyrings() 🔗

Return Type
[String ! ] !
Example
func (m *myModule) example(ctx context.Context, file *File) []string  {
	return dag.
			Apko().
			Config(file).
			Keyrings(ctx)
}
@function
async def example(file: dagger.File) -> List[str]:
	return await (
		dag.apko()
		.config(file)
		.keyrings()
	)
@func()
async example(file: File): Promise<string[]> {
	return dag
		.apko()
		.config(file)
		.keyrings()
}

archs() 🔗

Return Type
[String ! ] !
Example
func (m *myModule) example(ctx context.Context, file *File) []string  {
	return dag.
			Apko().
			Config(file).
			Archs(ctx)
}
@function
async def example(file: dagger.File) -> List[str]:
	return await (
		dag.apko()
		.config(file)
		.archs()
	)
@func()
async example(file: File): Promise<string[]> {
	return dag
		.apko()
		.config(file)
		.archs()
}

packages() 🔗

Return Type
[String ! ] !
Example
func (m *myModule) example(ctx context.Context, file *File) []string  {
	return dag.
			Apko().
			Config(file).
			Packages(ctx)
}
@function
async def example(file: dagger.File) -> List[str]:
	return await (
		dag.apko()
		.config(file)
		.packages()
	)
@func()
async example(file: File): Promise<string[]> {
	return dag
		.apko()
		.config(file)
		.packages()
}

withRepository() 🔗

Add a repository to the configuration.

Return Type
Config !
Arguments
NameTypeDefault ValueDescription
urlString !-No description provided
Example
func (m *myModule) example(file *File, url string) *ApkoConfig  {
	return dag.
			Apko().
			Config(file).
			WithRepository(url)
}
@function
def example(file: dagger.File, url: str) -> dag.ApkoConfig:
	return (
		dag.apko()
		.config(file)
		.with_repository(url)
	)
@func()
example(file: File, url: string): ApkoConfig {
	return dag
		.apko()
		.config(file)
		.withRepository(url)
}

withKeyring() 🔗

Add a keyring to the configuration.

Return Type
Config !
Arguments
NameTypeDefault ValueDescription
urlString !-No description provided
Example
func (m *myModule) example(file *File, url string) *ApkoConfig  {
	return dag.
			Apko().
			Config(file).
			WithKeyring(url)
}
@function
def example(file: dagger.File, url: str) -> dag.ApkoConfig:
	return (
		dag.apko()
		.config(file)
		.with_keyring(url)
	)
@func()
example(file: File, url: string): ApkoConfig {
	return dag
		.apko()
		.config(file)
		.withKeyring(url)
}

withArch() 🔗

Add an arch to the configuration.

Return Type
Config !
Arguments
NameTypeDefault ValueDescription
archString !-No description provided
Example
func (m *myModule) example(file *File, arch string) *ApkoConfig  {
	return dag.
			Apko().
			Config(file).
			WithArch(arch)
}
@function
def example(file: dagger.File, arch: str) -> dag.ApkoConfig:
	return (
		dag.apko()
		.config(file)
		.with_arch(arch)
	)
@func()
example(file: File, arch: string): ApkoConfig {
	return dag
		.apko()
		.config(file)
		.withArch(arch)
}

withPackage() 🔗

Add a package to the configuration.

Return Type
Config !
Arguments
NameTypeDefault ValueDescription
nameString !-No description provided
Example
func (m *myModule) example(file *File, name string) *ApkoConfig  {
	return dag.
			Apko().
			Config(file).
			WithPackage(name)
}
@function
def example(file: dagger.File, name: str) -> dag.ApkoConfig:
	return (
		dag.apko()
		.config(file)
		.with_package(name)
	)
@func()
example(file: File, name: string): ApkoConfig {
	return dag
		.apko()
		.config(file)
		.withPackage(name)
}

withPackages() 🔗

Add a list of packages to the configuration.

Return Type
Config !
Arguments
NameTypeDefault ValueDescription
pkgs[String ! ] !-No description provided
Example
func (m *myModule) example(file *File, pkgs []string) *ApkoConfig  {
	return dag.
			Apko().
			Config(file).
			WithPackages(pkgs)
}
@function
def example(file: dagger.File, pkgs: List[str]) -> dag.ApkoConfig:
	return (
		dag.apko()
		.config(file)
		.with_packages(pkgs)
	)
@func()
example(file: File, pkgs: string[]): ApkoConfig {
	return dag
		.apko()
		.config(file)
		.withPackages(pkgs)
}

build() 🔗

Build an image from configuration.

Return Type
BuildResult !
Arguments
NameTypeDefault ValueDescription
tagString !-No description provided
Example
func (m *myModule) example(file *File, tag string) *ApkoBuildResult  {
	return dag.
			Apko().
			Config(file).
			Build(tag)
}
@function
def example(file: dagger.File, tag: str) -> dag.ApkoBuildResult:
	return (
		dag.apko()
		.config(file)
		.build(tag)
	)
@func()
example(file: File, tag: string): ApkoBuildResult {
	return dag
		.apko()
		.config(file)
		.build(tag)
}

container() 🔗

Build a container from configuration.

Return Type
Container !
Example
func (m *myModule) example(file *File) *Container  {
	return dag.
			Apko().
			Config(file).
			Container()
}
@function
def example(file: dagger.File) -> dagger.Container:
	return (
		dag.apko()
		.config(file)
		.container()
	)
@func()
example(file: File): Container {
	return dag
		.apko()
		.config(file)
		.container()
}