Dockerのシステム出力(-tスイッチなし)

Dockerのシステム出力(-tスイッチなし)

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 には出力は表示されません。 dockerコマンドは私が使用しているコマンドランチャーに組み込まれているため、-tまたはスイッチを使用できません。-i出力を使用してsystemdを起動し、PID 1(エントリexecシェルから直接起動)を使用しますが、-tDocker ttyスイッチなしで上記のコマンドを変更するにはどうすればよいですか?

ベストアンサー1

おすすめ記事