[英]How to define the “docker container run” args in kubernetes
我的docker容器運行命令行包含很多args,例如:
docker container run --privileged --rm -u ${USER} -v $HOME:$HOME -e CURRENT_LOGLVL=$CURRENT_LOGLVL -it mydockerimg /bin/bash
這些參數的參考
--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中?
感謝您的提示或鏈接
對於特權容器, -u
需要使用安全上下文 。 同樣在kubernetes中,您可以使用--rm
標志。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.