我的docker容器运行命令行包含很多arg,例如:
docker container run --privileged --rm -u ${USER} -v $HOME:$HOME -e CURRENT_LOGLVL=$CURRENT_LOGLVL -it mydockerimg /bin/bash
这些args的参考
--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
我阅读了一些文档,例如 https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/ https://kubernetes.io/docs/concepts/storage/persistent-volumes/
可以找到与环境变量和体积有关的信息。
但是如何处理诸如--privileged
之类的其他参数?
有什么方法可以将这些参数直接传递给docker吗? 要么 无论如何,我是否手动运行docker命令行 但是K8S有某种方法可以将Docker容器实例转移到POD中?
感谢任何提示或链接