在 cent os 7
上运行 systemctl start 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 - 运行 systemctl 启动 newrelic-infra,错误 :Failed to get D-Bus connection: Operation not permitted,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54965720/