Where does Docker for Mac store PersistentVolume data on the local filesystem when using a HostPath?

4/12/2018

I have a Kubernetes PersistentVolume that mounts a directory using HostPath and it is cumbersome to boot up a Pod and exec onto it to view or change the data in that volume. Is it possible to locate the data in this volume on my local file system instead?

-- Cory Klein
docker
kubernetes

1 Answer

4/12/2018

Docker stores these volumes in /Users/username/.docker/Volumes/your-pv-name/pvc-SOME-UUID.

You can actually find the exact location by inspecting the PersistentVolume directly:

$ kubectl get pv -o=jsonpath='{.spec.hostPath.path}' some-persistent-volume-claim
/Users/youruser/.docker/Volumes/your-pv-name/pvc-4eafca67-3e94-11e8-9f11-025000000001
-- Cory Klein
Source: StackOverflow