
루트가 아닌 사용자로 centos+python3 기반 docker 컨테이너를 실행한 다음 컨테이너에서 호스트 서비스의 systemctl 상태를 가져오려고 합니다.
docker run --user=3001:3001 --userns=host -ti -v /run/systemd:/run/systemd --pid=host centos-python:latest /bin/bash
Failed to get D-Bus connection: No such file or directory
실행할 때 오류가 발생합니다.systemctl status httpd.service
그리고 루트로 실행하면 호스트에서 올바르게 실행되는 서비스의 systemctl 상태를 얻습니다.
루트가 아닌 사용자로 실행하려면 추가 볼륨 마운트를 수행해야 합니까, 아니면 루트가 아닌 사용자로서 systemctl 상태를 얻을 수 없습니까?