$ docker exec -it php bash
root@0fddab587d30:/# time php -i > /dev/null
real 0m0.029s
user 0m0.011s
sys 0m0.018s
Running strace on the host, through dockerd to the container
$ strace -c -f -S name docker run -d --rm php:cli php -i > /dev/null
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
0.04 0.000073 7 10 10 access
0.01 0.000025 25 1 arch_prctl
0.04 0.000064 21 3 brk
0.21 0.000359 45 8 clone
0.09 0.000158 9 17 close
0.02 0.000036 9 4 2 connect
0.02 0.000027 27 1 epoll_create1
0.04 0.000068 11 6 epoll_ctl
3.97 0.006676 56 120 epoll_wait
0.00 0.000000 0 1 execve
0.03 0.000056 14 4 fcntl
0.05 0.000082 6 13 fstat
72.92 0.122754 128 959 161 futex
0.00 0.000001 1 2 getpeername
0.00 0.000000 0 1 getpid
0.01 0.000022 22 1 getrandom
0.00 0.000000 0 2 getsockname
0.12 0.000199 22 9 gettid
0.00 0.000004 4 1 getuid
0.03 0.000044 22 2 1 ioctl
0.01 0.000011 6 2 lseek
0.78 0.001317 20 67 mmap
0.49 0.000821 24 34 mprotect
0.25 0.000427 39 11 munmap
0.01 0.000013 13 1 open
0.09 0.000154 11 14 openat
0.02 0.000027 27 1 prlimit64
17.57 0.029574 78 381 pselect6
0.10 0.000166 7 23 6 read
0.03 0.000046 46 1 readlinkat
1.50 0.002522 20 128 rt_sigaction
0.74 0.001241 9 132 rt_sigprocmask
0.02 0.000032 32 1 sched_getaffinity
0.30 0.000500 18 28 sched_yield
0.10 0.000175 19 9 set_robust_list
0.01 0.000025 25 1 set_tid_address
0.00 0.000000 0 2 setsockopt
0.19 0.000323 18 18 sigaltstack
0.03 0.000044 11 4 socket
0.13 0.000215 8 28 27 stat
0.03 0.000049 10 5 write
------ ----------- ----------- --------- --------- ----------------
100.00 0.168330 2056 207 total