事由:通过 systemctl start crond 启动任务时报错,具体如下

Failed to get D-Bus connection: Operation not permitted

解决方法:

  • 启动容器时指定参数 --privileged=true 并执行命令 /usr/sbin/init,完整如下
docker run -d --privileged=true --name centos7 centos /usr/sbin/init

然后通过 docker exec -it centos7 /bin/bash 进入容器操作

Logo

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

更多推荐