11
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Docker環境でstrace

Posted at

starceしようとしたらエラーになったので。

root:/# strace /bin/ls
strace: ptrace(PTRACE_TRACEME, ...): Operation not permitted
+++ exited with 1 +++

ぐぐれば何か出てきますよね。。。

起動オプションを追加すればよいようです。

--security-opt seccomp:unconfined

このオプションを追加したコンテナでstraceを実行すると

root@aca47db0b5ff:/# strace /bin/ls
execve("/bin/ls", ["/bin/ls"], [/* 9 vars */]) = 0
brk(NULL) = 0x72f000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fbbdf0de000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
...

11
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?