Docker exec与nsenter:任何陷阱? [英] Docker exec versus nsenter: Any gotchas?
问题描述
最近几个月,我一直在使用 nsenter ,以获得在容器上运行的shell用于调试目的。我听说过并使用了版本1.3中引入的 docker exec 。 Docker执行官似乎是新的最佳做法,以获得在一个用于调试目的的容器中,但我想知道使用docker exec和nsenter是否有任何缺点。比较两者的信息很少。在使用 docker exec
与nsenter之间有什么具体问题吗?
I've been using nsenter for the last few months to get a shell running on a container for debugging purposes. I have heard about and used docker exec which was introduced in version 1.3. Docker exec seems to be the new best practice for the purpose of getting inside a container for debugging purposes, but I'm wondering if there are any drawbacks to using docker exec versus nsenter. Information comparing the two is scant. Are there any specific problems I should watch out for or avoid when using docker exec
versus nsenter?
推荐答案
现在还不完全清楚。但是,我支持这样的观点,因为 docker exec
是正式的方法,与此同时。作者 nsenter
其实推荐使用 docker exec
。如果您遇到任何缺点,他鼓励您举报。
That is not entirely clear right now. But I would support the view that since docker exec
is the official way, to go with that. The author of nsenter
actually recommends using docker exec
. If you encounter any drawbacks, he encourages you to report them though.
这篇关于Docker exec与nsenter:任何陷阱?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!