apko
Build container images from apk packages.
Installation
dagger install github.com/felipepimentel/daggerverse/essentials/apko@v0.0.0
Entrypoint
Return Type
Apko !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
container | Container | - | Custom container to use as a base container. |
withoutCache | Boolean | - | 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
Name | Type | Default Value | Description |
---|---|---|---|
cache | CacheVolume ! | - | No description provided |
source | Directory | - | Identifier of the directory to use as the cache volume's root. |
sharing | Enum | - | 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
Name | Type | Default Value | Description |
---|---|---|---|
address | String ! | - | No description provided |
username | String ! | - | No description provided |
secret | Secret ! | - | 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
Name | Type | Default Value | Description |
---|---|---|---|
address | String ! | - | 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
Name | Type | Default Value | Description |
---|---|---|---|
config | File ! | - | Configuration file. |
tag | String ! | - | Image tag. |
lockfile | File | - | 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. |
buildDate | String | - | 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. |
offline | Boolean | - | 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. |
vcs | Boolean | true | Detect 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
Name | Type | Default Value | Description |
---|---|---|---|
config | File ! | - | Configuration file. |
tag | String ! | - | 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. |
buildDate | String | - | 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. |
offline | Boolean | - | 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. |
vcs | Boolean | true | Detect 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()
}