Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Subpath Support for Volumes in Docker-Py (#3243) #3270

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Khushiyant
Copy link
Contributor

@Khushiyant Khushiyant commented Jun 13, 2024

Adds #3243

This PR aims to implement subpath support for volumes in Docker-Py, allowing users to specify a subpath when creating a volume or a container. This feature is essential for scenarios where a container needs to access a specific directory within a volume.

Added a subpath parameter to the create_volume method in docker/api/volume.py.
Updated the Volume model in docker/models/volumes.py to include a subpath attribute.
Modified the create_container method in docker/api/container.py to include the subpath parameter when creating a mount.
Updated the Mount class in docker/types/mounts.py to include a subpath attribute.

This implementation is based on the Docker API documentation and might require further testing and refinements.
The subpath parameter is optional, and users can still create volumes and containers without specifying a subpath.

@Khushiyant Khushiyant changed the title Implement Subpath Support for Volumes in Docker-Py Implement Subpath Support for Volumes in Docker-Py (#3243) Jun 13, 2024
Adds support for specifying a subpath when creating a container
This allows users to specify a subdirectory within the volume to use as the container's root.

Changes:

* Added `subpath` parameter to `create_container` method in `docker/api/container.py`
* Updated `Mount` class in `docker/types/mounts.py` to include `subpath` attribute
* Modified `Container` model in `docker/models/containers.py` to include `subpath` attribute

BREAKING CHANGE: None

TESTED: Yes, added unit tests to verify subpath functionality
Signed-off-by: Khushiyant <khushiyant2002@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant