How to Enable Systemd service in openshift/jenkins-1-centos7 docker container?

爷,独闯天下 提交于 2019-12-08 23:38:29

In addition of your issue on openshift/jenkins, you also have docker issue 7459 which points out:

It works for me with this PR #25567 with just --cap-add SYS_ADMIN.

This commit is yet to be released in docker though.

Let me point out again that you do not need to run a systemd daemon in a systemd controlled container if it is just about running multiple services in it. Simply overwrite /usr/bin/systemctl with the docker-systemctl-replacement script. Then go to register it with CMD ["/usr/bin/systemctl"] as the init process of the container.

That's it. Now you can run any systemctl-start process from the operating system. It works to the extent that even provisioning with ansible/puppet scripts have no problem at all. And specficially, I am using that to provision Jenkins images with the operating system that the developers like to have as a basis.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!