Dagger
Search

utils

This file contains the container utils module, which is a set of functions that
can be used to modify a container and enhance its functionality in different ways.
Example (WithEnvVariables)
no available example in current language
func (m *Go) Utils_WithEnvVariables(envs *dagger.Secret) *dagger.Container {
	return dag.Utils().WithEnvVariables(dag.Container().From("alpine"), envs)
}
no available example in current language
no available example in current language

Installation

dagger install github.com/marcosnils/daggerverse/utils@v0.0.1

Entrypoint

Return Type
Utils
Example
dagger -m github.com/marcosnils/daggerverse/utils@38f9933ea3664e27a9ae9a2f80c96cb39d18a5c9 call \
func (m *myModule) example() *Utils  {
	return dag.
			Utils()
}
@function
def example() -> dag.Utils:
	return (
		dag.utils()
	)
@func()
example(): Utils {
	return dag
		.utils()
}

Types

Utils 🔗

withCommands() 🔗

WithCommands takes a container and a slice of command arguments and returns a new container with the specified commands. It generates a shell script based on the provided commands and sets it as the entrypoint for the container. The commands are executed when the container is started.

If the bash executable is not present, an error will be returned.

Parameters: - c: The original container. - cmds: A slice of command arguments. Each command is represented as a slice of strings.

Returns: - A new container with the specified commands. - An error if the bash executable is not present.

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
cContainer !-No description provided
cmds[List ! ] !-No description provided
Example
dagger -m github.com/marcosnils/daggerverse/utils@38f9933ea3664e27a9ae9a2f80c96cb39d18a5c9 call \
 with-commands --c IMAGE:TAG --cmds list1 --cmds list2
func (m *myModule) example(c *Container, cmds []) *Container  {
	return dag.
			Utils().
			WithCommands(c, cmds)
}
@function
def example(c: dagger.Container, cmds: List[]) -> dagger.Container:
	return (
		dag.utils()
		.with_commands(c, cmds)
	)
@func()
example(c: Container, cmds: []): Container {
	return dag
		.utils()
		.withCommands(c, cmds)
}

withEnvVariables() 🔗

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
cContainer !-No description provided
envsSecret !-No description provided
Example
dagger -m github.com/marcosnils/daggerverse/utils@38f9933ea3664e27a9ae9a2f80c96cb39d18a5c9 call \
 with-env-variables --c IMAGE:TAG --envs env:MYSECRET
func (m *myModule) example(c *Container, envs *Secret) *Container  {
	return dag.
			Utils().
			WithEnvVariables(c, envs)
}
@function
def example(c: dagger.Container, envs: dagger.Secret) -> dagger.Container:
	return (
		dag.utils()
		.with_env_variables(c, envs)
	)
@func()
example(c: Container, envs: Secret): Container {
	return dag
		.utils()
		.withEnvVariables(c, envs)
}