<p>My docker container run command line included a lot of args, for example:</p>

<pre><code>docker container run --privileged --rm -u ${USER} -v $HOME:$HOME -e CURRENT_LOGLVL=$CURRENT_LOGLVL -it mydockerimg /bin/bash
</code></pre>

<p>reference for these <a href="https://docs.docker.com/engine/reference/commandline/container_run/" rel="nofollow noreferrer">args</a></p>

<pre><code>--privileged      Give extended privileges to this container
I need to run in privilege mode to give extended privileges to this container

-v                 Bind mount a volume
I need to access a NFS mount point inside the docker container

-u                 Username or UID
I need to use special user

--rm            Automatically remove the container when it exits

-i      Keep STDIN open even if not attached

-e              environment variable
</code></pre>

<p>I read some docs like
<a href="https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/</a>
<a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/storage/persistent-volumes/</a></p>

<p>Environment variable and volume related information can be found.
But how to handle other args like <code>--privileged</code> and so on?</p>

<p>Is there some way to pass these args directly to docker?
OR
Is there anyway that I run the docker command line manually
but K8S have some way to transfer the docker container instance into a POD?</p>

<p>Thanks for any tips or links</p>

Evilight
<p>For privileged container and <code>-u</code> need use <a href="https://kubernetes.io/docs/tasks/configure-pod-container/security-context/" rel="nofollow noreferrer">secure context</a>.
Also in kubernetes, you can use <code>--rm</code> flag.</p>
