Retrieves this container plus a directory mounted at the given path. Parameters ---------- path: Location of the mounted directory (e.g., "/mnt/directory"). source: Identifier of the mounted directory. owner: A user:group t
(
self,
path: str,
source: "Directory",
*,
owner: str | None = "",
read_only: bool | None = False,
expand: bool | None = False,
)
| 3309 | return Container(_ctx) |
| 3310 | |
| 3311 | def with_mounted_directory( |
| 3312 | self, |
| 3313 | path: str, |
| 3314 | source: "Directory", |
| 3315 | *, |
| 3316 | owner: str | None = "", |
| 3317 | read_only: bool | None = False, |
| 3318 | expand: bool | None = False, |
| 3319 | ) -> Self: |
| 3320 | """Retrieves this container plus a directory mounted at the given path. |
| 3321 | |
| 3322 | Parameters |
| 3323 | ---------- |
| 3324 | path: |
| 3325 | Location of the mounted directory (e.g., "/mnt/directory"). |
| 3326 | source: |
| 3327 | Identifier of the mounted directory. |
| 3328 | owner: |
| 3329 | A user:group to set for the mounted directory and its contents. |
| 3330 | The user and group can either be an ID (1000:1000) or a name |
| 3331 | (foo:bar). |
| 3332 | If the group is omitted, it defaults to the same as the user. |
| 3333 | read_only: |
| 3334 | Mount the directory read-only. |
| 3335 | expand: |
| 3336 | Replace "${VAR}" or "$VAR" in the value of path according to the |
| 3337 | current environment variables defined in the container (e.g. |
| 3338 | "/$VAR/foo"). |
| 3339 | """ |
| 3340 | _args = [ |
| 3341 | Arg("path", path), |
| 3342 | Arg("source", source), |
| 3343 | Arg("owner", owner, ""), |
| 3344 | Arg("readOnly", read_only, False), |
| 3345 | Arg("expand", expand, False), |
| 3346 | ] |
| 3347 | _ctx = self._select("withMountedDirectory", _args) |
| 3348 | return Container(_ctx) |
| 3349 | |
| 3350 | def with_mounted_file( |
| 3351 | self, |