LoginSignup
8
6

More than 5 years have passed since last update.

Dockerでstraceを使う

Posted at

straceインストール

straceをてきとうにインストールする

FROM python:3.6-alpine

RUN apk update && apk add strace

実行

普通に実行すると Operation not permitted言われます。

$ docker run --rm xxxxx strace -c flask --version
strace: ptrace(PTRACE_TRACEME, ...): Operation not permitted

-cap-add sys_ptraceオプションを追加して ptrace(2)できるようにしてあげます。

$ docker run --rm --cap-add sys_ptrace xxxxx strace -c flask --version

参考

How-to Debug a Running Docker Container from a Separate Container

Docker privileged オプションについて

8
6
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
8
6