r"""Mount a local directory to the container. Args: path (str): The local path to mount. mount_path (str): The path to mount the local directory to in the container. Returns: DockerRuntime: The DockerRuntime instance.
(self, path: str, mount_path: str)
| 78 | self.client.images.pull(self.image) |
| 79 | |
| 80 | def mount(self, path: str, mount_path: str) -> "DockerRuntime": |
| 81 | r"""Mount a local directory to the container. |
| 82 | |
| 83 | Args: |
| 84 | path (str): The local path to mount. |
| 85 | mount_path (str): The path to mount the local directory to in the |
| 86 | container. |
| 87 | |
| 88 | Returns: |
| 89 | DockerRuntime: The DockerRuntime instance. |
| 90 | """ |
| 91 | |
| 92 | _path, _mount_path = Path(path), Path(mount_path) |
| 93 | if not _path.exists(): |
| 94 | raise FileNotFoundError(f"Path {_path} does not exist.") |
| 95 | if not _path.is_dir(): |
| 96 | raise NotADirectoryError(f"Path {_path} is not a directory.") |
| 97 | if not _path.is_absolute(): |
| 98 | raise ValueError(f"Path {_path} is not absolute.") |
| 99 | if not _mount_path.is_absolute(): |
| 100 | raise ValueError(f"Mount path {_mount_path} is not absolute.") |
| 101 | |
| 102 | self.mounts[_path] = _mount_path |
| 103 | return self |
| 104 | |
| 105 | def copy(self, source: str, dest: str) -> "DockerRuntime": |
| 106 | r"""Copy a file or directory to the container. |
nothing calls this directly
no outgoing calls
no test coverage detected