A simple command to show Docker volume/bind mounts

A quick command to show you mounts and volume mappings in your docker container:

docker inspect CONTAINER_NAME --format '{{ range .Mounts }}{{ .Source }} -> {{ .Destination }}{{ "\n" }}{{ end }}'

Sample response:

/dir1/file1.txt -> /app/data/file1.txt
/dir1/file2.conf -> /app/data/file2.conf
/dir1/dir2 -> /app/data/folder1

That’s it, Enjoy!

Unknown's avatar

About Ahmed Tawfik

Cybersecurity Professional, Systems Engineer, OSS & Linux Geek
This entry was posted in docker and tagged . Bookmark the permalink.

Leave a comment