User Tools

Site Tools


unix:systemd

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
unix:systemd [2018/04/17 15:02]
ap [Restart unit on failure]
unix:systemd [2018/12/21 09:42] (current)
ap systemd units in Docker
Line 72: Line 72:
  
 </​code>​ </​code>​
 +
 +===== systemd units in Docker =====
 +
 +This requires a fairly recent version of Centos7 / RHEL7
 +
 +
 +  * If using SElinux enable ''​setsebool -P container_manage_cgroup 1''​ in the host
 +  * In the Dockerfile:
 +    - Use the latest centos:7 or rhel7 base image
 +    - Set the environment variable container=docker
 +    - Set STOPSIGNAL to SIGRTMIN+3 to allow for a clean stop
 +    - use /sbin/init as a CMD
 +
 +Example:
 +
 +<​code>​
 +FROM centos:7
 +ENV container docker
 +STOPSIGNAL SIGRTMIN+3
 +RUN yum -y install httpd
 +systemctl enable httpd
 +EXPOSE 80
 +CMD [ "/​sbin/​init"​ ]
 +</​code>​
 +
 +
 +
unix/systemd.txt · Last modified: 2018/12/21 09:42 by ap

Informativa sui cookie