Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

D-Bus connection error when running systemctl inside container? #207

Open
gargworld opened this issue May 13, 2020 · 2 comments
Open

D-Bus connection error when running systemctl inside container? #207

gargworld opened this issue May 13, 2020 · 2 comments

Comments

@gargworld
Copy link

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.

@tolland
Copy link

tolland commented Dec 16, 2020

Probably need to start the container privileged

@Pythonov
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants