![如何检查 podman 容器内的核心转储?](https://linux22.com/image/788995/%E5%A6%82%E4%BD%95%E6%A3%80%E6%9F%A5%20podman%20%E5%AE%B9%E5%99%A8%E5%86%85%E7%9A%84%E6%A0%B8%E5%BF%83%E8%BD%AC%E5%82%A8%EF%BC%9F.png)
将核心转储重定向到 /ap_core 目录以供稍后共享
mkdir -p /ap_core && chmod 1777 /ap_core
cat /proc/sys/kernel/core_pattern
echo '/ap_core/core.t%t.u%u.s%s.p%p.%e' > /proc/sys/kernel/core_pattern
ls -alZ /ap_core
drwxrwxrwt. 2 root root unconfined_u:object_r:default_t:s0 15 Sep 5 10:10 .
dr-xr-xr-x. 19 root root system_u:object_r:root_t:s0 253 Jun 19 15:20 ..
启动容器
podman run --rm -i -t -v /ap_core:/ap_core:z ubi8/ubi-micro
sh-4.4# ls -al /ap_core
ls: cannot open directory '/ap_core': Permission denied
sh-4.4# ls -alZd /ap_core
drwxrwxrwt. 2 nobody nobody unconfined_u:object_r:default_t:s0 15 Sep 5 02:10 /ap_core
答案1
添加此选项--security-opt label=disable
则:z
没有必要。
podman run --rm -i -t --security-opt label=disable -v /ap_core:/ap_core ubi8/ubi-micro