Skip to content

Instantly share code, notes, and snippets.

@mthalman
Created February 3, 2023 16:54
Show Gist options
  • Select an option

  • Save mthalman/c63945163f883a0054f892fb88ee4bb0 to your computer and use it in GitHub Desktop.

Select an option

Save mthalman/c63945163f883a0054f892fb88ee4bb0 to your computer and use it in GitHub Desktop.
Get core dump from container
docker run --name test1 -it --entrypoint /bin/sh --privileged <image-name>

In Container:

echo "/cores/core" | tee /proc/sys/kernel/core_pattern
mkdir /cores
ulimit -c unlimited
<run command to caush crash>
exit

Back on host machine

# Copies core dump file from the container to your local dir
docker cp test1:/cores/core core

Clean up

docker rm test1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment