Docker Community Forums

Share and learn in the Docker community.

Systemd-analyze command in container


(Ruvenmil) #1

Hello,
it’s me again,
i run ubuntu:latest image in container, when i wrote the command system-analyze i got :
“Failed to create bus connection: No such file or directory”

i look about the command time docker run…but it’s not help me to know what is the process of build container.
what i have supposed to do in order to solve this problem?

thanks,
Ruven


(David Maze) #2

What is your actual goal with this?

systemd-analyze(1) says it’s to “analyze system boot-up performance”, and containers don’t generally “boot” in the same way a host system does. (Think of starting a container more like running a specially packaged single command than booting a VM.)

Typically containers don’t run systemd or any sort of init system, and your general expectation should be that systemd-specific commands like this one, or other init-related things like “service”, “systemctl”, “initctl”, and so on won’t work.

If you’re trying to wire this through to look at the host system’s boot time, that’d be an unusual application of Docker, especially since the container isn’t guaranteed to be running on a host that’s running systemd (Ubuntu 14.04, for instance, doesn’t). You’d also have to grant the container special privileges to access the host DBus socket, which is what your error really says, and I don’t know off hand how to do that.