Where is docker volume stored in the host computer for docker-compose?
Solution 1:
The volumes will normally be stored somewhere in /var/lib/docker/volumes/
To find out more, try the following commands
docker volume ls
docker volume inspect <volume identifier>
See also: https://www.linux.com/learn/docker-volumes-and-networks-compose
Solution 2:
On mac
docker volume ls
docker volume inspect <volume identifier>
Will give you the mount point within the Docker virtual filesystem, not on your mac filesystem.
Docker is not natively compatible with macOS, so Hyperkit is used to run a virtual image. Its virtual image data is located in:
~/Library/Containers/com.docker.docker/Data/vms/0
You can investigate your Docker root directory by creating a shell in the virtual environment:
screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty
cd /var/lib/docker/volumes/<volume identifier>/_data
ls
You can kill this session by pressing Ctrl+a, followed by pressing k and y.
Credit to: https://www.freecodecamp.org/news/where-are-docker-images-stored-docker-container-paths-explained/