将核心转储重定向到 /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