Docker Community Forums

Share and learn in the Docker community.

How to run docker stack in Privileged mode

I am trying to run apache inside my docker container. but it is only running in a stand alone container which I am running in privileged mode. Now I want to run same in Swarm cluster in a docker stack but I am getting following error while checking httpd status with "systemctl status httpd"

> System has not been booted with systemd as init system (PID 1). Can’t operate.
** > Failed to connect to bus: Host is down**

I have tried using the flag => “privileged: true” in my yml file but then I am getting this:

> Ignoring unsupported options: privileged

I am using version 3.1 in my yml file and
DockerCE 20.10.0
Docker-compose 1.21.2

How can I run a docker stack in privileged mode?

Thats because privileged is not supported in docker swarm. I had a similar docker compose running in privileged mode but while using it to docker swarm I removed them and was working well.

That not exactly an error .For example if you use something like links or depends_on . You get similar warning message. These are just the warnings not errors.

This is how you actually check the error logs if there is any

docker service ls (to check running service)

docker service logs servicename