I have a container using systemd inside it. The command into the container is /usr/sbin/init. This is a requirement so I cannot change that.

I also have a custom service running inside that container that fires up when the container is started. The service prints a lot of useful output to journald. So I can inspect the logs running the following:

$ docker exec -it mycontainer journalctl -xef

But I get nothing when running the following:

$ docker logs mycontainer

I have tried to configure both my custom service with StandardOutput=journal+console and journald to write to both wall and console. But I still get nothing.

Is there a way to redirect some or all of journald inside the container so that it shows up when I run docker logs mycontainer from the host?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.