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

825 views Asked by At
    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?

1

There are 1 answers

0
AudioBubble On BEST ANSWER

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.