运行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”命令。