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
dagger -m github.com/sagikazarmark/daggerverse/registry-config@5b7f915455413ec91b3463c6b631888c52f283f5 call \
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
Name | Type | Default Value | Description |
---|---|---|---|
address | String ! | - | No description provided |
username | String ! | - | No description provided |
secret | Secret ! | - | No description provided |
Example
dagger -m github.com/sagikazarmark/daggerverse/registry-config@5b7f915455413ec91b3463c6b631888c52f283f5 call \
with-registry-auth --address string --username string --secret env:MYSECRET
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
Name | Type | Default Value | Description |
---|---|---|---|
name | String | "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()
}