Когда образ Docker запускается в режиме терминала, например:
docker run --mount type=tmpfs,destination=/run --mount type=tmpfs,destination=/run/lock -v /sys/fs/cgroup:/sys/fs/cgroup:ro --entrypoint '/bin/bash' -it jrei/systemd-debian:10
, а затем введите вручную:
exec /lib/systemd/systemd
systemd отображает журнал инициализации как:
ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid)
Detected virtualization docker.
Detected architecture x86-64.
Welcome to Debian GNU/Linux 10 (buster)!
Set hostname to <e9366e98a874>.
File /lib/systemd/system/systemd-journald.service:12 configures an IP firewall (IPAddressDeny=any), but the local system does not support BPF/cgroup based firewalling.
Proceeding WITHOUT firewalling in effect! (This warning is only shown for the first loaded unit using IP firewalling.)
[ OK ] Reached target Slices.
[ OK ] Started Dispatch Password Requests to Console Directory Watch.
[ OK ] Reached target Swap.
[ OK ] Reached target Local File Systems.
Starting Create System Users...
[ OK ] Reached target Local Encrypted Volumes.
[ OK ] Reached target Paths.
....
Когда образ Docker запускается в режиме БЕЗ терминала, например:
docker run --mount type=tmpfs,destination=/run --mount type=tmpfs,destination=/run/lock -v /sys/fs/cgroup:/sys/fs/cgroup:ro --entrypoint '/bin/bash' jrei/systemd-debian:10 -c "exec /lib/systemd/systemd"
systemd не отображает вывод. Я не могу использовать переключатель -t
или -i
, поскольку команда docker жестко связана с используемым мной исполнителем команд. Как изменить указанную выше команду, чтобы запустить systemd с выводом и все еще с PID 1 (wth exec
непосредственно из оболочки ввода), но без -t
Docker tty-переключателя?