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.
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 bydocker volume inspect jowon't matchjohn. Similarly,docker run -it -v /something ubuntu sh, thendocker volume lsto get the volume ID, anddocker 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
-matchto 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.