容器内使用systemctl 命令时出现(System has not been booted with systemd as init system (PID 1). Can't operat....信息。

解决方案:/sbin/init

例如:Centos8

docker run -itd --name centos --privileged=true centos /sbin/init
docker exec -it centos /bin/bash

注意:--privileged=true一定要加上的。

余生很长,请多指教(微信公众号:灵心师)

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐