You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
D-Bus connection error when running systemctl inside container? #207
When I run systemctl command inside the container, I get D-Bus connection error
root@3924d7bb5e59 /]# systemctl status httpd
Failed to get D-Bus connection: Operation not permitted
can someone help or suggest what am I doing wrong.
Activity
tolland commentedon Dec 16, 2020
Probably need to start the container privileged
Pythonov commentedon May 20, 2022
This worked for me:
Dockerfile:
FROM centos/systemd:latest
RUN yum -y install openssh-server openssh-clients
CMD ["/bin/bash", "-c", "/usr/sbin/init"]
Part of docker-compose:
service_test:
build:
dockerfile: service_dockerfile
cap_add: [NET_ADMIN]
privileged: true
container_name: service_test
hostname: service_test