Skip to content

docker volume inspect doesn't do partial ID matching #26346

@lowenna

Description

@lowenna

This may be entirely by design, but I noticed it a year or so back when implementing volume support on Windows, made a note of it, then forgot about it 😊. However, someone else just pointed it out to me. Turns out it's not Windows specific - just tried on Ubuntu 16.04 running docker master.

For example, docker volume create john, followed by docker volume inspect jo won't match john. Similarly, docker run -it -v /something ubuntu sh, then docker volume ls to get the volume ID, and docker volume inspect <first few characters> will fail.

Unless completely by design, there's a couple of solutions. One is to do exactly as the daemon does for completion of container IDs. The second is to add a parameter to docker volume inspect such as -match to do regex/starting-with type matching on the volume ID.

Happy to do the work if it's something not explicitly by design. @cpuguy83 WDYT? Thx.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/cliClientexp/intermediatekind/enhancementEnhancements are not bugs or new features but can improve usability or performance.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions