MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / docker_driver_bind_strings

Function docker_driver_bind_strings

crates/openshell-driver-docker/src/lib.rs:1773–1792  ·  view source on GitHub ↗

Collect user-supplied bind mounts as string-format binds. Bind mounts use the legacy `Binds` field (`-v` syntax) rather than the structured `Mount` API because the Docker Engine Mount object does not support `SELinux` relabelling (`:z` / `:Z`). The string format does.

(config: &DockerSandboxDriverConfig)

Source from the content-addressed store, hash-verified

1771/// structured `Mount` API because the Docker Engine Mount object does not
1772/// support `SELinux` relabelling (`:z` / `:Z`). The string format does.
1773fn docker_driver_bind_strings(config: &DockerSandboxDriverConfig) -> Result<Vec<String>, Status> {
1774 config
1775 .mounts
1776 .iter()
1777 .filter_map(|m| match m {
1778 DockerDriverMountConfig::Bind {
1779 source,
1780 target,
1781 read_only,
1782 selinux_label,
1783 } => Some(docker_bind_string(
1784 source,
1785 target,
1786 *read_only,
1787 *selinux_label,
1788 )),
1789 _ => None,
1790 })
1791 .collect()
1792}
1793
1794fn docker_bind_string(
1795 source: &str,

Calls 1

docker_bind_stringFunction · 0.85

Tested by

no test coverage detected