$ docker run -it --name systemd-tutorial ubuntu
root@306c0deb6960:~# systemctl
bash: systemctl: command not found
為什么??
systemctl 實用程式在 Ubuntu 中默認可用,可用于使用命令“systemctl –no-pager”列出 Ubuntu 22.04 中的服務。
我的版本:
root@306c0deb6960:~# cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS"
...
uj5u.com熱心網友回復:
為什么?
容器通常用于單一服務作業,通常沒有完整的 systemd 服務管理套件,無論如何,如果無法訪問系統 dbus,容器將難以運行。所以,這是意料之中的。
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/537383.html
