How does docker generate core files?
Steps to generate core files for application services in docker containers:
1. Set the core file generation format and output path
Execute on the physical machine The following command:
echo "/data/cores/core.%p" | sudo tee /proc/sys/kernel/core_pattern
2. The docker container is hung from the core file path to the corresponding path of the physical machine.
for example: docker run -it -d /tmp/core:/data/cores test:v1.0 /bin/bash
3. Execute in the containerulimit -c umlimited
4. Simulate the core file generated in the container
kill -s SIGSEGV $$
After executing this command, a core file will be generated under the host /tmp/core
Related recommendations: docker tutorial
The above is the detailed content of How docker generates core files. For more information, please follow other related articles on the PHP Chinese website!