I made an image using dockerfile. And I created pod from the image that I created. But an error has occurred. When I get a shell to pod and used 'systemctl', I got a D-bus error. How can I solve this problem?
Failed to get D-Bus connection: Operation not permitted
You basically can't use systemctl
in Docker, since containers don't run the systemd
daemon. This is tricky to run in Docker itself, and the couple of workarounds that could make it go are difficult-to-impossible to express in Kubernetes.
You should come up with some other way to run your process. Usually a container will only run a single service, and so instead of starting it via a systemd unit file you can just run the service directly; your Dockerfile might end with something like
CMD ["/usr/sbin/myserviced", "--foreground"]