Is it possible to check service status using systemctl or service command in docker container?

I am running fedora container and trying to check the service status using systemctl or service command. But it is showing me below error:


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

If it is possible to run service command to manage the services in docker container? If yes, Please share the steps for the same.

Thanks in advance.

Docker containers are generally made to host a single service, thus, they don’t really use systemctl

Some containers do support systemd, in case you’re running multiple services on a single container, is that the case though?

For the status, you can define a healthcheck script that runs every certain interval and tests your service.
As for if the process is running, the container only runs so long as the process is running, so assuming your container is running, the process is as well