<p>I am able to run following plain docker command and volumes are created and mapped.This is privileged container.</p>
<p>docker run -d --network host --name test_container --volume test_volume:/mnt --privileged -v /dev:/dev $IMAGE_NAME</p>
<p>This container should be deployed as POD in kubernetes.</p>
<p>I tried creating podspec for this and its failing with below error :</p>
<p>Message:      OCI runtime create failed: container_linux.go:344: starting container process caused &quot;exec: &quot;/mnt/somescript.sh&quot;: stat /mnt/somescript.sh: no such file or directory&quot;</p>
<p>Below is the podspec snapshot:</p>
<pre><code>spec:
  automountServiceAccountToken: false
  containers:
    image: test_container:latest
    imagePullPolicy: IfNotPresent
    name: test-container
    resources: {}
    securityContext:
      privileged: true
    volumeMounts:
    - mountPath: &quot;/mnt&quot;
      name: testvolume
    - mountPath: &quot;/dev&quot;
      name: devdata
  hostNetwork: true
  hostname: test
  imagePullSecrets:
  - name: acr-pull
  nodeName: xxxxxx
  restartPolicy: Always
  volumes:
  - hostPath:
      path: /mnt
      type: Directory
    name: testvolume
  - hostPath:
      path: /dev
      type: Directory
    name:  devdata
</code></pre>
<p>Also volumes not getting created for /mnt and /dev dir of containers.</p>

Jayashree Madanala
<p>If your directory not exist you can give it try with <code>DirectoryOrCreate</code></p>
<pre><code>volumes:
- hostPath:
    path: /mnt
    type: DirectoryOrCreate
  name: testvolume
</code></pre>
<p>if it's not present it will create the path.</p>
<p>if your file in not getting mounted you can also give it try with <strong>subpath</strong></p>
<pre><code>somescript.sh
</code></pre>
