List Volumes in Docker Containers
With Docker 1.8.1 (August 2015), a docker inspect -f '{{ .Volumes }}' containerid
would be empty!
You now need to check Mounts
, which is a list of mounted paths like:
1 | { |
If you want the path of the first mount (for instance), that would be (using index 0):
docker inspect -f '{{ (index .Mounts 0).Source }}' containerid |
Pretty print the whole thing:
docker inspect -f '{{ json .Mounts }}' containerid | python -m json.tool |
Or use the jq
command:
docker inspect -f '{{ json .Mounts }}' containerid | jq |