<p>Having an issue with a kubernetes cronjob, when it runs it says that /usr/share/nginx/html is not a directory, &quot;no such file or directory&quot;, yet it definitely is, it's baked into the image, if i load the image up straight on docker the folder is definitely there.</p>
<p>Here is the yaml:</p>
<pre><code>apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: php-cron
spec:

  jobTemplate:
    spec:
      backoffLimit: 2
      activeDeadlineSeconds: 1800
      completions: 2
      parallelism: 2
      template:
        spec:
          containers:
            - name: php-cron-video
              image: my-image-here
              command:
                - &quot;cd /usr/share/nginx/html&quot;
                - &quot;php bin/console processvideo&quot;
              volumeMounts:
                - mountPath: /usr/share/nginx/html/uploads
                  name: uploads-volume
                - mountPath: /usr/share/nginx/html/private_uploads
                  name: private-uploads-volume
          restartPolicy: Never
          volumes:
            - name: uploads-volume
              hostPath:
                path: /data/website/uploads
                type: DirectoryOrCreate
            - name: private-uploads-volume
              hostPath:
                path: /data/website/private_uploads
                type: DirectoryOrCreate
  schedule:  &quot;* * * * *&quot;


docker run -it --rm my-image-here bash
</code></pre>
<p>Loads up straight into the /usr/share/nginx/html folder</p>
<p>What's going on here? The same image works fine as well as a normal deployment.</p>

noname
<p>Assumed your image truly has <code>/usr/share/nginx/html/bin</code> baked in, try changed the <code>command</code> to:</p>
<pre><code>...
command: [&quot;sh&quot;,&quot;-c&quot;,&quot;cd /usr/share/nginx/html &amp;&amp; php bin/console processvideo&quot;]
...
</code></pre>
