RUN systemctl在 cent OS 7 上启动newrelic-infra (在构建docker文件时)

我们获得以下错误信息:

Step 28/28 : RUN systemctl  start newrelic-infra
 ---> Running in f9a82da02f00
**Failed to get D-Bus connection: Operation not permitted**
The command '/bin/sh -c systemctl  start newrelic-infra' returned a non-zero code: 1

即使将这些步骤包含在docker文件中,

我遇到了同样的错误。我们该如何解决

最佳答案

挂载的卷可能在容器的运行期间起作用,而在构建期间却不能起作用。

在很多情况下,您都不需要在容器中运行systemd,因为您可以使用docker-systemctl-replacement脚本运行“systemctl”命令。

关于docker - RUN systemctl启动newrelic-infra,错误:无法获得D-Bus连接:不允许操作,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/54965720/

10-10 18:20