kubernetesdocker-for-mac

What's the base directory for hostPath volumes in Docker for Desktop on Mac?


    volumeMounts:
      - name: storage
        mountPath: /foo
  volumes:
    - name: storage
      hostPath:
        path: foo

If the value of the hostPath is set to a full path, i.e. /foo/bar/baz, the directory is created.

However, if it's set to just foo, I can't find it anywhere... Where is it located?


Solution

  • It seems there is no such thing as a base directory for hostPath volumes at the macOS level.

    Docker on Desktop works by provisioning a VM where the containers are run. It's inside this VM where the hostPath is mounted, so, if let's say I mount /tmp/, it's the /tmp inside such VM and not on macOS.