Skip to content

Instantly share code, notes, and snippets.

@r-k-b
Created October 27, 2021 23:15
Show Gist options
  • Save r-k-b/e90c222024ce1035d1a9b8cca52747bc to your computer and use it in GitHub Desktop.
Save r-k-b/e90c222024ce1035d1a9b8cca52747bc to your computer and use it in GitHub Desktop.
take a thread dump from a docker container running a mono process

take a thread dump from a docker container running a mono process

...when the container has no shell, so docker exec -it won't work.

steps

identify the Container ID of the problematic container

$ docker stats

find the PID of the app process (it may not be the main PID; if it were, docker kill would work)

$ docker container top abcd1234

send SIGQUIT to the app process

$ sudo kill -QUIT 1234567

extract the logs to a file

$ docker logs abcd1234 > dump.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment