Docker Community Forums

Share and learn in the Docker community.

How to run systemctl in Docker linux container


(Aditya21) #1

I am getting the following message when i am running command systemctl start nginx
Failed to get D-Bus connection: Operation not permitted . Anybody can help. Thanks.


(David Maze) #2

Don’t do that. Is it an image you created? Rewrite it to run the nginx command directly. As a general rule, assume commands like systemctl and service just don’t work in Docker.


(Aditya21) #3

thanks for reply it was not build my me. I just pulled using docker run .i just want to use an image from Docker for Jenkins master and slave.So i pulled two linux, ubuntu images. But was not able to install nginx. Hope you can help . Thank you.