Join GitHub today
Implement journalctl to see journald data within a docker container #10994
The basic idea is to allow us to run systemd/journald within a container and have the journal data exposed to the host.
In order to do this, we had to implement three different things.
With this patch you can do a
This has a secondary effect of allowing us to see and manipulate docker containers using machinectl. This will list all running containers, even if they are docker containers or systemd-nspawn containers. It will also list any VM's running on the machine.
changed the title from
This pull request implements journald within a docker container
Implement journalctl to see journald data within a docker container
Feb 24, 2015
You could build an image based on this Dockerfile to test.
Something like this should work, on a systemd based machine.
But even without the systemd within the journal you can see any container running using machinectl
And try out some of the other commands. machinectl kill does not seem to work for me, at least when I am running systemd as PID 1.
@rhatdan Hmm, maybe I'm doing something wrong, but I get
from your example. Could you recheck it pls?
@LK4D4 Try it now. I added the /run patch to stop you from having to run --privileged.
These patches are working for me with
docker build -t systemd-httpd .
@rhatdan I see machine in machinectl list. But
there about machine. Also
My host systemd is 219-r2. But I don't think it's an issue.
Well to get this stuff to fully work you need to volume mount in /run and /sys/fs/cgroup:ro
We have a separate patch that mounts /run as a tmpfs/ systemd will not run in a container properly without these two things, or in --privileged mode. Not sure why it killed X.