如何对docker容器使用strace进行debug?

Posted futuretea

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了如何对docker容器使用strace进行debug?相关的知识,希望对你有一定的参考价值。

命令如下:

alias cstrace='cstrace(){PID=$(cpid "$1");shift;sudo strace -tt -T -f -s 200 -p "${PID}" $@};cstrace $@'

使用方法

假设docker容器名叫test

cstrace test

以上是关于如何对docker容器使用strace进行debug?的主要内容,如果未能解决你的问题,请参考以下文章