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

Method with_workdir

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

Change the container's working directory. Like WORKDIR in Dockerfile. Parameters ---------- path: The path to set as the working directory (e.g., "/app"). expand: Replace "${VAR}" or "$VAR" in the value of path according to the cur

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

Source from the content-addressed store, hash-verified

3683 return Container(_ctx)
3684
3685 def with_workdir(
3686 self,
3687 path: str,
3688 *,
3689 expand: bool | None = False,
3690 ) -> Self:
3691 """Change the container's working directory. Like WORKDIR in Dockerfile.
3692
3693 Parameters
3694 ----------
3695 path:
3696 The path to set as the working directory (e.g., "/app").
3697 expand:
3698 Replace "${VAR}" or "$VAR" in the value of path according to the
3699 current environment variables defined in the container (e.g.
3700 "/$VAR/foo").
3701 """
3702 _args = [
3703 Arg("path", path),
3704 Arg("expand", expand, False),
3705 ]
3706 _ctx = self._select("withWorkdir", _args)
3707 return Container(_ctx)
3708
3709 def without_annotation(self, name: str) -> Self:
3710 """Retrieves this container minus the given OCI annotation.

Callers 15

test_service_start_stopFunction · 0.80
grep_dirMethod · 0.80
fooMethod · 0.80
clone_with_sshMethod · 0.80
_testMethod · 0.80
cloneMethod · 0.80
buildMethod · 0.80
build_envMethod · 0.80
buildMethod · 0.80
buildMethod · 0.80
buildMethod · 0.80
buildMethod · 0.80

Calls 3

ArgClass · 0.90
_selectMethod · 0.80
ContainerClass · 0.70

Tested by 11

test_service_start_stopFunction · 0.64
test_versionFunction · 0.64
test_versionFunction · 0.64
test_versionFunction · 0.64
test_versionFunction · 0.64
test_versionFunction · 0.64
test_versionFunction · 0.64
test_versionFunction · 0.64
test_versionFunction · 0.64
test_versionFunction · 0.64
test_versionFunction · 0.64