docker volume ls --format "{{.Name}}: {{.Driver}}: {{.Label "Mounts.Destination"}}"
Template parsing error: template: :1: function "Mounts" not defined
docker volume ls --format "{{.Name}}: {{.Driver}}: {{.Label "project.Mounts.Destination"}}"
Template parsing error: template: :1: function "project" not defined
docker volume ls --format "{{.Name}}: {{.Driver}}: {{.Label "mounts.destination"}}"
Template parsing error: template: :1: function "mounts" not defined
I had created the volume at build in my Dockerfile VOLUME ["bitcoin-data:/home/BTC/data"] should I have done it in a better format or another way to show some indication in ls as to what the volume is? Because these long ids mean nothing to me
A volume mapping can not be declared in the Dockerfile. You can only mark a path as mount target and flag it as Volume. some management UIs use this information to prepoulate configuration fields.
The mapping you seek to create in your Dockerfile can only be done on container level. E.g. when starting the container with docker run ... -v bitcoin-data:/home/BTC/data or it’s docker compose equivalent.
Note: if a path is marked as VOLUME in a Dockerfile and a container based on the resulting image is started without mapping a volume or a bind to it, an anonymous volume will be created and mounted into the container path. They have random alphanum names and are listed by docker volume ls. That’s why most people stopped declaring VOLUME instructions in their Dockerfiles at all - they can not be undone on container level.
In case you are unclear about the required template variables to be used with format, you can use docker volume ls --format "{{json .}}" to see the structure and values in json format.