Home >Operation and Maintenance >Docker >How docker generates core files

How docker generates core files

WJ
WJOriginal
2020-06-08 17:00:493485browse

How docker generates core files

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn