Is there a way to list files inside a docker volume?

You can use a temporary container for this. I tend to use busybox for these temporary containers:

$ docker volume ls
DRIVER              VOLUME NAME
local               jenkins-home
local               jenkins-home2
local               jenkinsblueocean_jenkins-data
...

$ docker run -it --rm -v jenkins-home:/vol busybox ls -l /vol
total 428
-rw-r--r--    1 1000     1000           327 Jul 14  2016 com.dabsquared.gitlabjenkins.GitLabPushTrigger.xml
-rw-r--r--    1 1000     1000           276 Aug 17  2016 com.dabsquared.gitlabjenkins.connection.GitLabConnectionConfig.xml
-rw-r--r--    1 1000     1000           256 Aug 17  2016 com.nirima.jenkins.plugins.docker.DockerPluginConfiguration.xml
drwxr-xr-x   28 1000     1000          4096 Aug 17  2016 config-history
-rw-r--r--    1 1000     1000          6460 Aug 17  2016 config.xml
-rw-r--r--    1 1000     1000        174316 Jun  2 18:50 copy_reference_file.log
-rw-r--r--    1 1000     1000          2875 Aug  9  2016 credentials.xml
...

For a host volume, you can just replace the volume mount with the host directory name (fully qualified) in the docker run cli.

$ docker run -it --rm -v /path/on/host:/vol busybox ls -l /vol

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)