docker-py icon indicating copy to clipboard operation
docker-py copied to clipboard

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

Open Khushiyant opened this issue 1 year ago • 5 comments

Closes #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 avatar Jun 13 '24 13:06 Khushiyant

Hello, can this PR be merged ASAP?

rayrapetyan avatar Sep 16 '24 00:09 rayrapetyan

@rayrapetyan Even, I'm also waiting for the review

Khushiyant avatar Sep 16 '24 04:09 Khushiyant

@thaJeztah @krissetto, could you provide a review please, this seems like a very simple and straightforward change. Thanks!

rayrapetyan avatar Sep 16 '24 05:09 rayrapetyan

@Khushiyant, could you re-trigger the build as seems one of the integration tests has failed before.

rayrapetyan avatar Sep 16 '24 17:09 rayrapetyan

@Khushiyant, could you re-trigger the build as seems one of the integration tests has failed before.

Yeah, I triggered the build and now, all tests have passed

Khushiyant avatar Sep 17 '24 10:09 Khushiyant

I have cleaned up the commit history while removing unnecessary changes and also corrected tests

Khushiyant avatar Mar 18 '25 17:03 Khushiyant