ccproxy.docker.docker_path¶
ccproxy.docker.docker_path
¶
Docker path management with clean API.
DockerPath
¶
Bases: BaseModel
Represents a mapping between host and container paths.
Provides a clean API for Docker volume mounting and path resolution.
Example
workspace = DockerPath(host_path="/some/host/local/path", container_path="/tmp/docker/workspace") docker_vol = workspace.vol() # Returns volume mapping tuple container_path = workspace.container() # Returns container path host_path = workspace.host() # Returns host path
vol
¶
container
¶
join
¶
Create new DockerPath with subpaths joined to both host and container paths.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
*subpaths
|
str
|
Path components to join |
()
|
Returns:
Name | Type | Description |
---|---|---|
DockerPath |
DockerPath
|
New instance with joined paths |
Source code in ccproxy/docker/docker_path.py
DockerPathSet
¶
Collection of named Docker paths for organized path management.
Example
paths = DockerPathSet("/tmp/build") paths.add("workspace", "/workspace") paths.add("config", "/workspace/config")
workspace_vol = paths.get("workspace").vol() config_path = paths.get("config").container()
Parameters:
Name | Type | Description | Default |
---|---|---|---|
base_host_path
|
str | Path | None
|
Base path on host for all paths in this set |
None
|
Source code in ccproxy/docker/docker_path.py
add
¶
Add a named Docker path to the set.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Logical name for the path |
required |
container_path
|
str
|
Path inside the Docker container |
required |
host_subpath
|
str | None
|
Optional subpath from base_host_path, defaults to name |
None
|
Returns:
Name | Type | Description |
---|---|---|
Self |
Self
|
For method chaining |
Source code in ccproxy/docker/docker_path.py
add_path
¶
Add a pre-created DockerPath to the set.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Logical name for the path |
required |
docker_path
|
DockerPath
|
DockerPath instance to add |
required |
Returns:
Name | Type | Description |
---|---|---|
Self |
Self
|
For method chaining |
Source code in ccproxy/docker/docker_path.py
get
¶
Get Docker path by name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Logical name of the path |
required |
Returns:
Name | Type | Description |
---|---|---|
DockerPath |
DockerPath
|
The Docker path instance |
Raises:
Type | Description |
---|---|
KeyError
|
If path name is not found |