Opens an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default). Parameters ---------- cmd: If set, override the container's default terminal command and
(
self,
*,
cmd: list[str] | None = None,
experimental_privileged_nesting: bool | None = False,
insecure_root_capabilities: bool | None = False,
)
| 2667 | return self.sync().__await__() |
| 2668 | |
| 2669 | def terminal( |
| 2670 | self, |
| 2671 | *, |
| 2672 | cmd: list[str] | None = None, |
| 2673 | experimental_privileged_nesting: bool | None = False, |
| 2674 | insecure_root_capabilities: bool | None = False, |
| 2675 | ) -> Self: |
| 2676 | """Opens an interactive terminal for this container using its configured |
| 2677 | default terminal command if not overridden by args (or sh as a |
| 2678 | fallback default). |
| 2679 | |
| 2680 | Parameters |
| 2681 | ---------- |
| 2682 | cmd: |
| 2683 | If set, override the container's default terminal command and |
| 2684 | invoke these command arguments instead. |
| 2685 | experimental_privileged_nesting: |
| 2686 | Provides Dagger access to the executed command. |
| 2687 | insecure_root_capabilities: |
| 2688 | Execute the command with all root capabilities. This is similar to |
| 2689 | running a command with "sudo" or executing "docker run" with the " |
| 2690 | --privileged" flag. Containerization does not provide any security |
| 2691 | guarantees when using this option. It should only be used when |
| 2692 | absolutely necessary and only with trusted commands. |
| 2693 | """ |
| 2694 | _args = [ |
| 2695 | Arg("cmd", [] if cmd is None else cmd, []), |
| 2696 | Arg( |
| 2697 | "experimentalPrivilegedNesting", experimental_privileged_nesting, False |
| 2698 | ), |
| 2699 | Arg("insecureRootCapabilities", insecure_root_capabilities, False), |
| 2700 | ] |
| 2701 | _ctx = self._select("terminal", _args) |
| 2702 | return Container(_ctx) |
| 2703 | |
| 2704 | async def up( |
| 2705 | self, |