<p>I am running minikube v0.24.1. In this minikube, I will create a Pod for my nginx application. And also I want to pass data from my local directory.</p>

<p>That means I want to mount my local <code>$HOME/go/src/github.com/nginx</code> into my Pod</p>

<p>How can I do this?</p>

<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: nginx
spec:
  containers:
  - image: nginx:0.1
    name: nginx
    volumeMounts:
    - mountPath: /data
      name: volume
  volumes:
  - name: volume
    hostPath:
      path: /data
</code></pre>

<p>You can't mount your local directory into your Pod directly.</p>
<p>First, you need to mount your directory <code>$HOME/go/src/github.com/nginx</code> into your minikube.</p>
<pre><code>$ minikube start --mount-string=&quot;$HOME/go/src/github.com/nginx:/data&quot; --mount
</code></pre>
<p>Then If you mount <code>/data</code> into your Pod using hostPath, you will get you local directory data into Pod.</p>
<p>There is <strong>another way</strong></p>
<p>Host's <code>$HOME</code> directory gets mounted into minikube's <code>/hosthome</code> directory. Here you will get your data</p>
<pre><code>$ ls -la /hosthome/go/src/github.com/nginx
</code></pre>
<p>So to mount this directory, you can change your Pod's hostPath</p>
<pre><code>hostPath:
  path: /hosthome/go/src/github.com/nginx
</code></pre>
