Dagger
Search

apko

Build container images from apk packages.

Installation

dagger install github.com/felipepimentel/daggerverse/essentials/apko@v0.0.0

Entrypoint

Return Type
Apko !
Arguments
NameTypeDefault ValueDescription
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()
}

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.
sharingEnum -Sharing mode of the cache volume.
Example
func (m *myModule) 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)
}

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)
}

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)
}

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)
}

BuildResult 🔗

file() 🔗

Return Type
File !
Example
func (m *myModule) example(config *File, tag string) *File  {
	return dag.
			Apko().
			Build(config, tag).
			File()
}

tag() 🔗

Return Type
String !
Example
func (m *myModule) example(ctx context.Context, config *File, tag string) string  {
	return dag.
			Apko().
			Build(config, tag).
			Tag(ctx)
}

asContainer() 🔗

Import the image into a container.

Return Type
Container !
Example
func (m *myModule) example(config *File, tag string) *Container  {
	return dag.
			Apko().
			Build(config, tag).
			AsContainer()
}