Dagger
Search

registry-config

Tools interacting with an OCI registry usually have their own way to authenticate. Helm, for example, provides a command to "login" into a registry, which stores the credentials in a file. That is, however, not a safe way to store credentials, especially not in Dagger. Credentials persisted in the filesystem make their way into Dagger's layer cache.

This module creates a configuration file and returns it as a Secret that can be mounted safely into a Container.

Be advised that using the tool's built-in authentication mechanism may not work with the configuration file (since it's read only).

You can read more about the topic in [this issue](https://github.com/dagger/dagger/issues/7273).

Installation

dagger install github.com/sagikazarmark/daggerverse/registry-config@v0.1.1

Entrypoint

Return Type
RegistryConfig
Example
func (m *myModule) example() *RegistryConfig  {
	return dag.
			RegistryConfig()
}
@function
def example() -> dag.RegistryConfig:
	return (
		dag.registry_config()
	)
@func()
example(): RegistryConfig {
	return dag
		.registryConfig()
}

Types

RegistryConfig 🔗

withRegistryAuth() 🔗

Add credentials for a registry.

Return Type
RegistryConfig !
Arguments
NameTypeDefault ValueDescription
addressString !-No description provided
usernameString !-No description provided
secretSecret !-No description provided
Example
dagger -m github.com/sagikazarmark/daggerverse/registry-config@5b7f915455413ec91b3463c6b631888c52f283f5 call \
 with-registry-auth --address string --username string --secret env:MYSECRET \
 secret
func (m *myModule) example(address string, username string, secret *Secret) *RegistryConfig  {
	return dag.
			RegistryConfig().
			WithRegistryAuth(address, username, secret)
}
@function
def example(address: str, username: str, secret: dagger.Secret) -> dag.RegistryConfig:
	return (
		dag.registry_config()
		.with_registry_auth(address, username, secret)
	)
@func()
example(address: string, username: string, secret: Secret): RegistryConfig {
	return dag
		.registryConfig()
		.withRegistryAuth(address, username, secret)
}

secret() 🔗

Create the registry configuration.

Return Type
Secret !
Arguments
NameTypeDefault ValueDescription
nameString "registry-config"No description provided
Example
dagger -m github.com/sagikazarmark/daggerverse/registry-config@5b7f915455413ec91b3463c6b631888c52f283f5 call \
 secret
func (m *myModule) example() *Secret  {
	return dag.
			RegistryConfig().
			Secret()
}
@function
def example() -> dagger.Secret:
	return (
		dag.registry_config()
		.secret()
	)
@func()
example(): Secret {
	return dag
		.registryConfig()
		.secret()
}