<p>I have one docker image with default ENTRYPOINT as entrypoint.sh whose job is to execute another shell script passed as an argument to this entrypoint.sh.
Now I am using this image as initContainer for some container. I want to pass two arguments to this initContainer. Currently I am doing as below but it is not working.</p>
<pre><code>initContainers:
 - name: init
   image: &lt;image_name&gt;
   args: [&quot;agr1 agr2&quot;]
      
</code></pre>

Pooja singh
<p>You can use the <strong>comma</strong> in between</p>
<pre><code>containers:
  - name: command-demo-container
    image: debian
    command: [&quot;printenv&quot;]
    args: [&quot;HOSTNAME&quot;, &quot;KUBERNETES_PORT&quot;]
</code></pre>
<p>Ref document : <a href="https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/</a></p>
<p>Multiple argument example</p>
<pre><code>initContainers:
  - name: init-myservice
    image: busybox:1.28
    command: ['sh', '-c', &quot;until nslookup myservice.$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace).svc.cluster.local; do echo waiting for myservice; sleep 2; done&quot;]
</code></pre>
<p>Or <strong>list</strong></p>
<pre><code>containers:
  - name: busybox
    image: busybox
    args:
    - sleep
    - &quot;1000000&quot;
</code></pre>
<p>Same way you can pass to the <strong>CMD</strong> &amp; <strong>Entrypoint</strong></p>
