Search code examples
dockerdocker-composegrafanadocker-volume

How to determine the container id or image name of an unknown docker volume


Please how do I determine the container id or image name of an unknown docker volume? For example I was able to find the list of docker volumes by running the command 'docker volume ls' but unfortunately when I was building some of the images I didn't mount a specific volume so most of my containers were built without a volume name. some of the examples of volumes with unknown names are listed below

3199e3e4f3c2b79f04b84523959cb250223a229fca2ba16540cdbfd77762a552 c1cba1883daed381d83d9940d48e5f5aceed327614c58dc4bfa3cd7a6849274f f2545f7cdef79e8c59dd8fc2a6d6de83876231554a738d25fe1f61f93c6b3eb9 f9cce0cfdd8ef8bae1e19aa41864e25f074929863a771b0ec729a119e2e880f7

Please how to determine the container id or image name of an unknown docker volumes

How can I determine which of the volumes is for MYSQL, JENKINS, PROMETHEUS for example??

REASON FOR MY QUESTION

I am trying to enable alerts on Grafana so I can get a notification via email but I got this error message

"For email alerts I get this message. SMTP not configured, check your grafana.ini config file’s [smtp] section"

This means that I have to edit the grafana.ini config file which is mounted in the docker grafana volume but I am not able to do this.

Please I will appreciate your help.

Thanks


Solution

  • Please use:

    docker ps -a --filter volume={{reference}}
    

    Example:

    docker ps -a --filter volume=3199e3e4f3c2b79f04b84523959cb250223a229fca2ba16540cdbfd77762a552