Created
August 29, 2019 19:27
-
-
Save jbodah/14a38cbff2474feb40d223f308074723 to your computer and use it in GitHub Desktop.
strace a container
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ docker ps | |
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | |
2cdef4202c1c cg-ruby-sem_sem "rails c" 19 minutes ago Up 19 minutes 3000/tcp cg-ruby-sem_sem_run_73d6529b9b23 | |
$ cat Dockerfile.debug | |
FROM alpine | |
RUN apk update && apk add strace | |
CMD ["strace", "-p", "1"] | |
$ docker build -f Dockerfile.debug -t strace . | |
$ docker run -it --pid=container:2cdef4202c1c --net=container:2cdef4202c1c --cap-add sys_admin --cap-add sys_ptrace strace | |
strace: Process 1 attached | |
read(7, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment