Closed vellotis closed 3 years ago
I can't help debug this, because not on Windows. Does this work on Linux?
I tried it out on Ubuntu 20.10 host running on VMware Workstation 16 virtualization. The behavior is the same:
docker
is captured fine.
docker run --name systemd-logging \
--security-opt seccomp=unconfined \
--tmpfs /tmp \
--tmpfs /run \
--tmpfs /run/lock \
-v /sys/fs/cgroup:/sys/fs/cgroup:ro \
-t systemd-logging
docker-compose
is not captured.
docker-compose up
After some testing, adding tty: true
fix the issue. It was the option missing compared to the docker run
command, which has the -t
(or --tty
) option.
I'm struggling with getting
systemd
output withdocker-compose
. While executing with plaindocker run
I successfully get the stdout.I'm guessing that it has something to do with https://github.com/moby/moby/issues/27202. But I may be wrong.
My dockerfile
The following run command shows the stdout from the
sleep & echo
service.The equivalent docker-compose setup doesn't show the output or even the systemd bootup entries.
and
docker-compose up
.I have also tried to utilize
CMD ["/bin/bash", "-c", "exec /sbin/init --log-target=journal 3>&1"]
but without success.I would be grateful if anybody would have any hunch on this problem. Thanks.