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,
)
| 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. |