strace: ptrace(PTRACE_TRACEME, ...): Operation not permitted

在docker容器中,运行strace 发现错误:

[root@cc2ca6c035d7 /]# strace -o log /bin/ls
strace: ptrace(PTRACE_TRACEME, ...): Operation not permitted

解决方法添加 --cap-add=SYS_PTRACE
nvidia-docker run -it --cap-add=SYS_PTRACE docker.io/ansible/centos7-ansible

参考学习:
https://blog.csdn.net/do_it_/article/details/79867474

你可能感兴趣的:(docker,docker,strace)