<p>What is the difference in below three declarations for passing command/arguments:</p>
<ol>
<li><p>containers:<br />
name: busybox<br />
image: busybox<br />
args:<br />
-sleep<br />
-&quot;1000&quot;</p>
</li>
<li><p>containers:<br />
name: busybox<br />
image: busybox<br />
command: [&quot;/bin/sh&quot;, &quot;-c&quot;, &quot;sleep 1000&quot;]</p>
</li>
<li><p>containers:<br />
name: busybox<br />
image: busybox<br />
args:<br />
-sleep<br />
-&quot;1000&quot;</p>
</li>
</ol>
<p>A. Would these produce same result?<br />
B. What is the preference or usage for each?</p>

PS-Atl
<p>The YAML list definition are only a matter of taste, it's just a YAML syntax. This two examples are equivalent:</p>
<pre><code>listOne:
- item1
- item2
listTwo: ['item1', 'item2']
</code></pre>
<p>And this syntax works for both <strong>args</strong> and <strong>command</strong>. Beside that <strong>args</strong> and <strong>command</strong> are slight different, as the documentation says:</p>
<ul>
<li>If you do not supply command or args for a Container, the defaults
defined in the Docker image are used</li>
<li>If you supply a command but no args for a Container, only the supplied command is used. The default EntryPoint and the default Cmd defined in the Docker image are ignored.</li>
<li>If you supply only args for a Container, the default Entrypoint defined in the Docker image is run with the args that you supplied.</li>
<li>If you supply a command and args, the default Entrypoint and the default Cmd defined in the Docker image are ignored. Your command is run with your args.</li>
</ul>
<p>Imagine a container like <strong>mysql</strong>, if you look it's Dockerfile you'll notice this:</p>
<pre><code>ENTRYPOINT [&quot;docker-entrypoint.sh&quot;]
CMD [&quot;mysqld&quot;]
</code></pre>
<p>The <strong>entrypoint</strong> call a script that prepare everything the database needs, when finish, this script calls <code>exec &quot;$@&quot;</code> and the shell variable <code>$@</code> are everything defined in <strong>cmd</strong>.</p>
<p>So, on Kubernetes, if you want to pass arguments to <strong>mysqld</strong> you do something like:</p>
<pre class="lang-yaml prettyprint-override"><code>image: mysql
args:
- mysqld
- --skip-grant-tables
# or args: [&quot;mysqld&quot;, &quot;--skip-grant-tables&quot;]
</code></pre>
<p>This still executes the <strong>entrypoint</strong> but now, the value of <code>$@</code> is <code>mysqld --skip-grant-tables</code>.</p>
