MCPcopy Create free account
hub / github.com/dagger/dagger / with_env_variable

Method with_env_variable

sdk/python/src/dagger/client/gen.py:3007–3033  ·  view source on GitHub ↗

Set a new environment variable in the container. Parameters ---------- name: Name of the environment variable (e.g., "HOST"). value: Value of the environment variable. (e.g., "localhost"). expand: Replace "${VAR}" or "$VAR"

(
        self,
        name: str,
        value: str,
        *,
        expand: bool | None = False,
    )

Source from the content-addressed store, hash-verified

3005 return Container(_ctx)
3006
3007 def with_env_variable(
3008 self,
3009 name: str,
3010 value: str,
3011 *,
3012 expand: bool | None = False,
3013 ) -> Self:
3014 """Set a new environment variable in the container.
3015
3016 Parameters
3017 ----------
3018 name:
3019 Name of the environment variable (e.g., "HOST").
3020 value:
3021 Value of the environment variable. (e.g., "localhost").
3022 expand:
3023 Replace "${VAR}" or "$VAR" in the value according to the current
3024 environment variables defined in the container (e.g.
3025 "/opt/bin:$PATH").
3026 """
3027 _args = [
3028 Arg("name", name),
3029 Arg("value", value),
3030 Arg("expand", expand, False),
3031 ]
3032 _ctx = self._select("withEnvVariable", _args)
3033 return Container(_ctx)
3034
3035 def with_error(self, err: str) -> Self:
3036 """Raise an error.

Callers 15

pendingMethod · 0.45
module_defsMethod · 0.45
databaseMethod · 0.45
set_env_varMethod · 0.45
buildMethod · 0.45
buildMethod · 0.45
buildMethod · 0.45
buildMethod · 0.45
buildMethod · 0.45
env_variables_innerMethod · 0.45
buildMethod · 0.45
buildMethod · 0.45

Calls 3

ArgClass · 0.90
_selectMethod · 0.80
ContainerClass · 0.70

Tested by

no test coverage detected