Docker CentOS Failed to get D-Bus connection: Operation not permitted

Question

The CentOS container is started based on docker. You need to use systemctl start XXX to start the service in the CentOS container. An error occurred:

Failed to get D-Bus connection: Operation not permitted

reason

The permission of ptrace system call. By default, the container does not have permission to ptrace process.

resolvent

When starting the container, turn on the privileged mode through privileged = true , and start it with /usr/SBIN/init as the entry command, for example:

docker run -d -name centos7 --privileged=true centos:7 /usr/sbin/init

After entering the container with the command docker exec - it centos7/bin/bash , you can start the service internally with systemctl start .


(END)


Read More: